Commit 10cfa908 authored by Cosimo Cecchi's avatar Cosimo Cecchi

spinbutton: redesign to use an horizontal layout

Rewrite GtkSpinButton to use a touchscreen friendly horizontal layout.
Other features include:
- support for theming buttons with nth-child
- full support for RTL
- use + and - symbolic icons instead of arrows
- general streamlining and cleanup of a lot of related code

https://bugzilla.gnome.org/show_bug.cgi?id=663359
parent 03b7bb6e
This diff is collapsed.
......@@ -207,7 +207,9 @@ gboolean gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button)
void gtk_spin_button_update (GtkSpinButton *spin_button);
/* private */
GdkWindow* _gtk_spin_button_get_panel (GtkSpinButton *spin_button);
void _gtk_spin_button_get_panels (GtkSpinButton *spin_button,
GdkWindow **down_panel,
GdkWindow **up_panel);
G_END_DECLS
......
......@@ -208,18 +208,18 @@ gtk_test_spin_button_click (GtkSpinButton *spinner,
guint button,
gboolean upwards)
{
GdkWindow *panel;
GdkWindow *down_panel = NULL, *up_panel = NULL, *panel;
gboolean b1res = FALSE, b2res = FALSE;
panel = _gtk_spin_button_get_panel (spinner);
_gtk_spin_button_get_panels (spinner, &down_panel, &up_panel);
panel = (upwards) ? up_panel : down_panel;
if (panel)
{
gint width, pos;
width = gdk_window_get_width (panel);
pos = upwards ? 0 : gdk_window_get_height (panel) - 1;
b1res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
b2res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
gint width = gdk_window_get_width (panel);
b1res = gdk_test_simulate_button (panel, width - 1, 1, button, 0, GDK_BUTTON_PRESS);
b2res = gdk_test_simulate_button (panel, width - 1, 1, button, 0, GDK_BUTTON_RELEASE);
}
return b1res && b2res;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment