scrollbar: deprecate min-slider-length style property

In favor of min-height/min-width, like we did for other similar
properties.
This commit is contained in:
Cosimo Cecchi 2016-02-22 22:00:57 -08:00
parent 0974b0d843
commit f0d9afd300
4 changed files with 26 additions and 11 deletions

View File

@ -30,6 +30,7 @@
#include "gtkadjustment.h"
#include "gtkintl.h"
#include "gtkorientable.h"
#include "gtkprivate.h"
@ -92,6 +93,14 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
widget_class->style_updated = gtk_scrollbar_style_updated;
/**
* GtkScrollbar:min-slider-length:
*
* Minimum length of scrollbar slider.
*
* Deprecated: 3.20: Use min-height/min-width CSS properties on the slider
* element instead. The value of this style property is ignored.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("min-slider-length",
P_("Minimum Slider Length"),
@ -99,7 +108,7 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
0,
G_MAXINT,
21,
GTK_PARAM_READABLE));
GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boolean ("fixed-slider-length",
@ -148,9 +157,14 @@ gtk_scrollbar_update_style (GtkScrollbar *scrollbar)
gboolean has_a, has_b, has_c, has_d;
GtkRange *range = GTK_RANGE (scrollbar);
GtkWidget *widget = GTK_WIDGET (scrollbar);
GtkCssGadget *slider_gadget = gtk_range_get_slider_gadget (range);
gtk_css_gadget_get_preferred_size (slider_gadget,
gtk_orientable_get_orientation (GTK_ORIENTABLE (scrollbar)), -1,
&slider_length, NULL,
NULL, NULL);
gtk_widget_style_get (widget,
"min-slider-length", &slider_length,
"fixed-slider-length", &fixed_size,
"has-backward-stepper", &has_a,
"has-secondary-forward-stepper", &has_b,

View File

@ -2008,9 +2008,6 @@ scrollbar {
@at-root * {
-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
}
$_slider_margin: 3px;
@ -2106,6 +2103,7 @@ scrollbar {
&.vertical {
slider {
margin-left: 1px + $_slider_margin;
min-height: 42px;
min-width: 6px;
&:dir(rtl) {
@ -2137,6 +2135,7 @@ scrollbar {
slider {
margin-top: 1px + $_slider_margin;
min-height: 6px;
min-width: 42px;
}
&.fine-tune slider { margin-top: 1px + $_slider_fine_tune_margin; }

View File

@ -2220,8 +2220,7 @@ notebook > stack:not(:only-child) {
**************/
* {
-GtkScrollbar-has-backward-stepper: false;
-GtkScrollbar-has-forward-stepper: false;
-GtkScrollbar-min-slider-length: 42; }
-GtkScrollbar-has-forward-stepper: false; }
scrollbar button {
border: none; }
scrollbar.vertical button.down {
@ -2275,6 +2274,7 @@ scrollbar.fine-tune slider {
margin: 4px; }
scrollbar.vertical slider {
margin-left: 4px;
min-height: 42px;
min-width: 6px; }
scrollbar.vertical slider:dir(rtl) {
margin-left: 3px;
@ -2291,7 +2291,8 @@ scrollbar.vertical trough {
border-right-style: solid; }
scrollbar.horizontal slider {
margin-top: 4px;
min-height: 6px; }
min-height: 6px;
min-width: 42px; }
scrollbar.horizontal.fine-tune slider {
margin-top: 5px; }
scrollbar.horizontal trough {

View File

@ -2230,8 +2230,7 @@ notebook > stack:not(:only-child) {
**************/
* {
-GtkScrollbar-has-backward-stepper: false;
-GtkScrollbar-has-forward-stepper: false;
-GtkScrollbar-min-slider-length: 42; }
-GtkScrollbar-has-forward-stepper: false; }
scrollbar button {
border: none; }
scrollbar.vertical button.down {
@ -2285,6 +2284,7 @@ scrollbar.fine-tune slider {
margin: 4px; }
scrollbar.vertical slider {
margin-left: 4px;
min-height: 42px;
min-width: 6px; }
scrollbar.vertical slider:dir(rtl) {
margin-left: 3px;
@ -2301,7 +2301,8 @@ scrollbar.vertical trough {
border-right-style: solid; }
scrollbar.horizontal slider {
margin-top: 4px;
min-height: 6px; }
min-height: 6px;
min-width: 42px; }
scrollbar.horizontal.fine-tune slider {
margin-top: 5px; }
scrollbar.horizontal trough {