121
121
GParamSpec *pspec);
122
static void gtk_scale_button_set_orientation_private (GtkScaleButton *button,
123
GtkOrientation orientation);
122
124
static gboolean gtk_scale_button_scroll (GtkWidget *widget,
123
125
GdkEventScroll *event);
124
126
static void gtk_scale_button_screen_changed (GtkWidget *widget,
436
438
case PROP_ORIENTATION:
437
gtk_scale_button_set_orientation (button, g_value_get_enum (value));
439
gtk_scale_button_set_orientation_private (button, g_value_get_enum (value));
440
442
gtk_scale_button_set_value (button, g_value_get_double (value));
739
741
gtk_scale_button_set_orientation (GtkScaleButton *button,
740
742
GtkOrientation orientation)
742
GtkScaleButtonPrivate *priv;
744
744
g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
746
gtk_scale_button_set_orientation_private (button, orientation);
750
* gtk_scale_button_get_plus_button:
751
* @button: a #GtkScaleButton
753
* Retrieves the plus button of the #GtkScaleButton.
755
* Returns: the plus button of the #GtkScaleButton.
760
gtk_scale_button_get_plus_button (GtkScaleButton *button)
762
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
764
return button->plus_button;
768
* gtk_scale_button_get_minus_button:
769
* @button: a #GtkScaleButton
771
* Retrieves the minus button of the #GtkScaleButton.
773
* Returns: the minus button of the #GtkScaleButton.
778
gtk_scale_button_get_minus_button (GtkScaleButton *button)
780
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
782
return button->minus_button;
786
* gtk_scale_button_get_popup:
787
* @button: a #GtkScaleButton
789
* Retrieves the popup of the #GtkScaleButton.
791
* Returns: the popup of the #GtkScaleButton
796
gtk_scale_button_get_popup (GtkScaleButton *button)
798
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
800
return button->priv->dock;
804
gtk_scale_button_set_orientation_private (GtkScaleButton *button,
805
GtkOrientation orientation)
807
GtkScaleButtonPrivate *priv = button->priv;
748
809
if (orientation != priv->orientation)
793
* gtk_scale_button_get_plus_button:
794
* @button: a #GtkScaleButton
796
* Retrieves the plus button of the #GtkScaleButton.
798
* Returns: the plus button of the #GtkScaleButton.
803
gtk_scale_button_get_plus_button (GtkScaleButton *button)
805
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
807
return button->plus_button;
811
* gtk_scale_button_get_minus_button:
812
* @button: a #GtkScaleButton
814
* Retrieves the minus button of the #GtkScaleButton.
816
* Returns: the minus button of the #GtkScaleButton.
821
gtk_scale_button_get_minus_button (GtkScaleButton *button)
823
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
825
return button->minus_button;
829
* gtk_scale_button_get_popup:
830
* @button: a #GtkScaleButton
832
* Retrieves the popup of the #GtkScaleButton.
834
* Returns: the popup of the #GtkScaleButton
839
gtk_scale_button_get_popup (GtkScaleButton *button)
841
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
843
return button->priv->dock;
847
854
* button callbacks.
998
1007
x += button_event->x;
1009
/* Move the dock, but set is_moved so we
1010
* don't forward the first click later on,
1011
* as it could make the scale go to the bottom */
1002
else if (y + d->allocation.height > rect.height + rect.y)
1015
} else if (y + d->allocation.height > rect.height + rect.y) {
1003
1016
y = rect.y + rect.height - d->allocation.height;
1007
else if (x + d->allocation.width > rect.width + rect.x)
1023
} else if (x + d->allocation.width > rect.width + rect.x) {
1008
1024
x = rect.x + rect.width - d->allocation.width;
1011
1029
gtk_window_move (GTK_WINDOW (priv->dock), x, y);