diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-12-08 17:28:08 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-12-08 17:32:05 -0500 |
commit | d405a5bbe399d8b430b00d944e70dbc31a59706c (patch) | |
tree | 95c89784528a18f37277c611ee8f3b0f837aede0 | |
parent | eed1831caf93b790b9366b40e0dc4337c7f5abfd (diff) | |
download | gtk+-wip/style-property-reduction.tar.gz |
Minimize use of style properties in themeswip/style-property-reduction
Change the default values of style properties where possible to
avoid having to specify these in Adwaita and HighContrast.
-rw-r--r-- | gtk/gtkcombobox.c | 4 | ||||
-rw-r--r-- | gtk/gtkdialog.c | 4 | ||||
-rw-r--r-- | gtk/gtkexpander.c | 2 | ||||
-rw-r--r-- | gtk/gtkmenu.c | 2 | ||||
-rw-r--r-- | gtk/gtknotebook.c | 10 | ||||
-rw-r--r-- | gtk/gtkscrollbar.c | 6 | ||||
-rw-r--r-- | gtk/gtkscrolledwindow.c | 4 | ||||
-rw-r--r-- | gtk/gtkstatusbar.c | 2 | ||||
-rw-r--r-- | gtk/gtktoolbutton.c | 14 | ||||
-rw-r--r-- | gtk/gtktoolitemgroup.c | 2 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 4 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 2 | ||||
-rw-r--r-- | gtk/theme/Adwaita/_common.scss | 50 | ||||
-rw-r--r-- | gtk/theme/HighContrast/_common.scss | 51 |
14 files changed, 28 insertions, 129 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index ccda6ad457..c62e40a7d2 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -1051,9 +1051,9 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) g_param_spec_float ("arrow-scaling", P_("Arrow Scaling"), P_("The amount of space used by the arrow"), - 0, + 0.0, 2.0, - 1.0, + 0.5, GTK_PARAM_READABLE)); /** diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index b02c6048c1..0f73b1227a 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -612,7 +612,7 @@ gtk_dialog_class_init (GtkDialogClass *class) P_("Spacing between buttons"), 0, G_MAXINT, - 6, + 4, GTK_PARAM_READABLE)); /** @@ -629,7 +629,7 @@ gtk_dialog_class_init (GtkDialogClass *class) P_("Width of border around the button area at the bottom of the dialog"), 0, G_MAXINT, - 5, + 0, GTK_PARAM_READABLE)); /** diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index 030f5a87ad..7bad4bcfdd 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -106,7 +106,7 @@ #include "a11y/gtkexpanderaccessible.h" -#define DEFAULT_EXPANDER_SIZE 10 +#define DEFAULT_EXPANDER_SIZE 16 #define DEFAULT_EXPANDER_SPACING 2 #define TIMEOUT_EXPAND 500 diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 6862ca994e..08a660ca28 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -707,7 +707,7 @@ gtk_menu_class_init (GtkMenuClass *class) P_("Extra space at the top and bottom of the menu"), 0, G_MAXINT, - 1, + 0, GTK_PARAM_READABLE | G_PARAM_DEPRECATED)); diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 2635d1c9ec..e223f72ba3 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -881,7 +881,7 @@ gtk_notebook_class_init (GtkNotebookClass *class) P_("Size of tab overlap area"), G_MININT, G_MAXINT, - 2, + -8, GTK_PARAM_READABLE)); /** @@ -897,7 +897,7 @@ gtk_notebook_class_init (GtkNotebookClass *class) P_("Size of tab curvature"), 0, G_MAXINT, - 1, + 0, GTK_PARAM_READABLE)); /** @@ -914,7 +914,7 @@ gtk_notebook_class_init (GtkNotebookClass *class) P_("Scroll arrow spacing"), 0, G_MAXINT, - 0, + 5, GTK_PARAM_READABLE)); /** @@ -931,7 +931,7 @@ gtk_notebook_class_init (GtkNotebookClass *class) P_("Initial gap before the first tab"), 0, G_MAXINT, - 0, + 10, GTK_PARAM_READABLE)); /** @@ -948,7 +948,7 @@ gtk_notebook_class_init (GtkNotebookClass *class) g_param_spec_boolean ("has-tab-gap", P_("Tab gap"), P_("Active tab is drawn with a gap at the bottom"), - TRUE, + FALSE, GTK_PARAM_READABLE)); /** diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index a609045c86..7b609ba4cc 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -72,7 +72,7 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class) P_("Minimum length of scrollbar slider"), 0, G_MAXINT, - 21, + 42, GTK_PARAM_READABLE)); gtk_widget_class_install_style_property (widget_class, @@ -86,14 +86,14 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class) g_param_spec_boolean ("has-backward-stepper", P_("Backward stepper"), P_("Display the standard backward arrow button"), - TRUE, + FALSE, GTK_PARAM_READABLE)); gtk_widget_class_install_style_property (widget_class, g_param_spec_boolean ("has-forward-stepper", P_("Forward stepper"), P_("Display the standard forward arrow button"), - TRUE, + FALSE, GTK_PARAM_READABLE)); gtk_widget_class_install_style_property (widget_class, diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 86a53d75fb..c831a26a0a 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -142,7 +142,7 @@ * under A) at least correspond to the space taken up by its scrollbars. */ -#define DEFAULT_SCROLLBAR_SPACING 3 +#define DEFAULT_SCROLLBAR_SPACING 0 #define TOUCH_BYPASS_CAPTURED_THRESHOLD 30 /* Kinetic scrolling */ @@ -498,7 +498,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) g_param_spec_boolean ("scrollbars-within-bevel", P_("Scrollbars within bevel"), P_("Place scrollbars within the scrolled window's bevel"), - FALSE, + TRUE, GTK_PARAM_READABLE)); gtk_widget_class_install_style_property (widget_class, diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index 9cb3106670..d131f415c5 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -165,7 +165,7 @@ gtk_statusbar_class_init (GtkStatusbarClass *class) P_("Shadow type"), P_("Style of bevel around the statusbar text"), GTK_TYPE_SHADOW_TYPE, - GTK_SHADOW_IN, + GTK_SHADOW_NONE, GTK_PARAM_READABLE)); /* Bind class to template diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 07344cdb85..fd03245042 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -302,13 +302,13 @@ gtk_tool_button_class_init (GtkToolButtonClass *klass) * Since: 2.10 */ gtk_widget_class_install_style_property (widget_class, - g_param_spec_int ("icon-spacing", - P_("Icon spacing"), - P_("Spacing in pixels between the icon and label"), - 0, - G_MAXINT, - 3, - GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); + g_param_spec_int ("icon-spacing", + P_("Icon spacing"), + P_("Spacing in pixels between the icon and label"), + 0, + G_MAXINT, + 4, + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); /** * GtkToolButton::clicked: diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c index 94655b7536..c47b7ff5e1 100644 --- a/gtk/gtktoolitemgroup.c +++ b/gtk/gtktoolitemgroup.c @@ -32,7 +32,7 @@ #define ANIMATION_TIMEOUT 50 #define ANIMATION_DURATION (ANIMATION_TIMEOUT * 4) #define DEFAULT_ANIMATION_STATE TRUE -#define DEFAULT_EXPANDER_SIZE 16 +#define DEFAULT_EXPANDER_SIZE 11 #define DEFAULT_HEADER_SPACING 2 #define DEFAULT_LABEL "" diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 8c55dacda9..5f05223bd8 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1213,9 +1213,9 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); /* Style properties */ -#define _TREE_VIEW_EXPANDER_SIZE 14 +#define _TREE_VIEW_EXPANDER_SIZE 11 #define _TREE_VIEW_VERTICAL_SEPARATOR 2 -#define _TREE_VIEW_HORIZONTAL_SEPARATOR 2 +#define _TREE_VIEW_HORIZONTAL_SEPARATOR 4 gtk_widget_class_install_style_property (widget_class, g_param_spec_int ("expander-size", diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index f0f2f6aa58..34efd84569 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -3614,7 +3614,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS g_param_spec_int ("focus-padding", P_("Focus padding"), P_("Width, in pixels, between focus indicator and the widget 'box'"), - 0, G_MAXINT, 1, + 0, G_MAXINT, 2, GTK_PARAM_READABLE | G_PARAM_DEPRECATED)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_widget_class_install_style_property (klass, diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss index 2840af32c5..02deb0a11e 100644 --- a/gtk/theme/Adwaita/_common.scss +++ b/gtk/theme/Adwaita/_common.scss @@ -6,44 +6,8 @@ $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); * { padding: 0; - -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: $error_color; - -GtkCheckButton-indicator-size: 16; - -GtkCheckMenuItem-indicator-size: 16; - - // The size for scrollbars. The slider is 2px smaller, but we keep it - // up so that the whole area is sensitive to button presses for the - // slider. The stepper button is larger in both directions, the slider - // only in the width - - -GtkScrolledWindow-scrollbar-spacing: 0; - -GtkScrolledWindow-scrollbars-within-bevel: 1; - - -GtkToolItemGroup-expander-size: 11; - -GtkExpander-expander-size: 16; - -GtkTreeView-expander-size: 11; - - -GtkTreeView-horizontal-separator: 4; - - -GtkMenu-horizontal-padding: 0; - -GtkMenu-vertical-padding: 0; - - -GtkWidget-link-color: $link_color; - -GtkWidget-visited-link-color: $link_visited_color; - - -GtkWidget-focus-padding: 2; // FIXME: do we still need these? - -GtkWidget-focus-line-width: 1; // - - -GtkDialog-button-spacing: 4; - -GtkDialog-action-area-border: 0; - - -GtkStatusbar-shadow-type: none; - - // We use the outline properties to signal the focus properties - // to the adwaita engine: using real CSS properties is faster, - // and we don't use any outlines for now. - outline-color: transparentize($fg_color, 0.7); outline-style: dashed; outline-offset: -3px; @@ -1039,8 +1003,6 @@ GtkComboBox { > .button { padding-top: 3px; padding-bottom: 4px; } // Otherwise combos // are bigger then // buttons - -GtkComboBox-arrow-scaling: 0.5; - -GtkComboBox-shadow-type: none; box-shadow: 0 1px $borders_edge; @@ -1636,13 +1598,6 @@ column-header.button.dnd { // for treeview-like derive widgets // Abandon all hope — Ye Who Enter Here padding: 0; background-color: $base_color; - -GtkNotebook-initial-gap: 10; - -GtkNotebook-arrow-spacing: 5; - -GtkNotebook-tab-curvature: 0; - -GtkNotebook-tab-overlap: -8; - -GtkNotebook-has-tab-gap: false; - -GtkWidget-focus-padding: 0; - -GtkWidget-focus-line-width: 0; transition: all 200ms $ease-out-quad; &:backdrop { background-color: $backdrop_base_color; @@ -1885,11 +1840,6 @@ column-header.button.dnd { // for treeview-like derive widgets .scrollbar { -GtkRange-slider-width: 13; -GtkRange-trough-border: 1; - -GtkScrollbar-has-backward-stepper: false; - -GtkScrollbar-has-forward-stepper: false; - -GtkScrollbar-min-slider-length: 42; // minimum size for the slider. - // sadly can't be in '.slider' - // where it belongs -GtkRange-stepper-spacing: 0; -GtkRange-trough-under-steppers: 1; diff --git a/gtk/theme/HighContrast/_common.scss b/gtk/theme/HighContrast/_common.scss index 7fedf8464b..9f05073de4 100644 --- a/gtk/theme/HighContrast/_common.scss +++ b/gtk/theme/HighContrast/_common.scss @@ -4,46 +4,10 @@ * { padding: 0; - -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: $error_color; -GtkPaned-handle-size: 1; -gtk-icon-style: symbolic; //force symbolic style icons - -GtkCheckButton-indicator-size: 16; - -GtkCheckMenuItem-indicator-size: 16; - - // The size for scrollbars. The slider is 2px smaller, but we keep it - // up so that the whole area is sensitive to button presses for the - // slider. The stepper button is larger in both directions, the slider - // only in the width - - -GtkScrolledWindow-scrollbar-spacing: 0; - -GtkScrolledWindow-scrollbars-within-bevel: 1; - - -GtkToolItemGroup-expander-size: 11; - -GtkExpander-expander-size: 16; - -GtkTreeView-expander-size: 11; - - -GtkTreeView-horizontal-separator: 4; - - -GtkMenu-horizontal-padding: 0; - -GtkMenu-vertical-padding: 0; - - -GtkWidget-link-color: $link_color; - -GtkWidget-visited-link-color: $link_color; - - -GtkWidget-focus-padding: 2; // FIXME: do we still need these? - -GtkWidget-focus-line-width: 1; // - - -GtkDialog-button-spacing: 4; - -GtkDialog-action-area-border: 0; - - -GtkStatusbar-shadow-type: none; - - // We use the outline properties to signal the focus properties - // to the adwaita engine: using real CSS properties is faster, - // and we don't use any outlines for now. - outline-color: transparentize($fg_color, 0.7); outline-style: dashed; outline-offset: -3px; @@ -733,10 +697,6 @@ GtkComboBox { //FIXME padding issue padding: 0; - - -GtkComboBox-arrow-scaling: 0.5; - -GtkComboBox-shadow-type: none; - box-shadow: 0 1px $borders_edge; @include _button_text_shadow; @@ -1120,11 +1080,6 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells // Abandon all hope — Ye Who Enter Here padding: 0; background-color: $base_color; - -GtkNotebook-initial-gap: 10; - -GtkNotebook-arrow-spacing: 5; - -GtkNotebook-tab-curvature: 0; - -GtkNotebook-tab-overlap: -8; - -GtkNotebook-has-tab-gap: false; -GtkWidget-focus-padding: 0; -GtkWidget-focus-line-width: 0; transition: all 200ms ease-out; @@ -1356,13 +1311,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells background-image: none; border-style: solid; -GtkRange-trough-border: 0; - -GtkScrollbar-has-backward-stepper: false; - -GtkScrollbar-has-forward-stepper: false; -GtkRange-slider-width: 20; - -GtkScrollbar-min-slider-length: 42; // minimum size for the slider. - // sadly can't be in '.slider' - // where it belongs - -GtkRange-stepper-spacing: 0; -GtkRange-trough-under-steppers: 1; .button { |