Swap GTK_ARROW_LEFT and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,

Fri Mar 12 17:20:15 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkarrow.c (gtk_arrow_expose): Swap GTK_ARROW_LEFT
        and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,
        Semion Chichelnitsky)

        * gtk/gtkpathbar.c gtk/gtktoolbar.c: Remove no-longer-needed
        gtk_toolbar_direction-changed handlers and explicit
        flipping of GtkArrow widgets.
This commit is contained in:
Owen Taylor 2004-03-12 22:51:13 +00:00 committed by Owen Taylor
parent 543b1c2f78
commit dcb6900c61
8 changed files with 66 additions and 66 deletions

View File

@ -1,3 +1,13 @@
Fri Mar 12 17:20:15 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkarrow.c (gtk_arrow_expose): Swap GTK_ARROW_LEFT
and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,
Semion Chichelnitsky)
* gtk/gtkpathbar.c gtk/gtktoolbar.c: Remove no-longer-needed
gtk_toolbar_direction-changed handlers and explicit
flipping of GtkArrow widgets.
Fri Mar 12 23:37:15 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkfilechooserdialog.c

View File

@ -1,3 +1,13 @@
Fri Mar 12 17:20:15 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkarrow.c (gtk_arrow_expose): Swap GTK_ARROW_LEFT
and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,
Semion Chichelnitsky)
* gtk/gtkpathbar.c gtk/gtktoolbar.c: Remove no-longer-needed
gtk_toolbar_direction-changed handlers and explicit
flipping of GtkArrow widgets.
Fri Mar 12 23:37:15 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkfilechooserdialog.c

View File

@ -1,3 +1,13 @@
Fri Mar 12 17:20:15 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkarrow.c (gtk_arrow_expose): Swap GTK_ARROW_LEFT
and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,
Semion Chichelnitsky)
* gtk/gtkpathbar.c gtk/gtktoolbar.c: Remove no-longer-needed
gtk_toolbar_direction-changed handlers and explicit
flipping of GtkArrow widgets.
Fri Mar 12 23:37:15 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkfilechooserdialog.c

View File

@ -1,3 +1,13 @@
Fri Mar 12 17:20:15 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkarrow.c (gtk_arrow_expose): Swap GTK_ARROW_LEFT
and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,
Semion Chichelnitsky)
* gtk/gtkpathbar.c gtk/gtktoolbar.c: Remove no-longer-needed
gtk_toolbar_direction-changed handlers and explicit
flipping of GtkArrow widgets.
Fri Mar 12 23:37:15 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkfilechooserdialog.c

View File

@ -1,3 +1,13 @@
Fri Mar 12 17:20:15 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkarrow.c (gtk_arrow_expose): Swap GTK_ARROW_LEFT
and GTK_ARROW_RIGHT for GTK_TEXT_DIR_LTR. (#129159,
Semion Chichelnitsky)
* gtk/gtkpathbar.c gtk/gtktoolbar.c: Remove no-longer-needed
gtk_toolbar_direction-changed handlers and explicit
flipping of GtkArrow widgets.
Fri Mar 12 23:37:15 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkfilechooserdialog.c

View File

@ -234,6 +234,7 @@ gtk_arrow_expose (GtkWidget *widget,
gint x, y;
gint extent;
gfloat xalign;
GtkArrowType effective_arrow_type;
if (GTK_WIDGET_DRAWABLE (widget))
{
@ -243,11 +244,18 @@ gtk_arrow_expose (GtkWidget *widget,
width = widget->allocation.width - misc->xpad * 2;
height = widget->allocation.height - misc->ypad * 2;
extent = MIN (width, height) * 0.7;
effective_arrow_type = arrow->arrow_type;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
xalign = misc->xalign;
else
xalign = 1.0 - misc->xalign;
{
xalign = 1.0 - misc->xalign;
if (arrow->arrow_type == GTK_ARROW_LEFT)
effective_arrow_type = GTK_ARROW_RIGHT;
else if (arrow->arrow_type == GTK_ARROW_RIGHT)
effective_arrow_type = GTK_ARROW_LEFT;
}
x = floor (widget->allocation.x + misc->xpad
+ ((widget->allocation.width - extent) * xalign)
@ -273,7 +281,7 @@ gtk_arrow_expose (GtkWidget *widget,
gtk_paint_arrow (widget->style, widget->window,
widget->state, shadow_type,
&event->area, widget, "arrow",
arrow->arrow_type, TRUE,
effective_arrow_type, TRUE,
x, y, extent, extent);
}

View File

@ -73,8 +73,6 @@ static void gtk_path_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_path_bar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_path_bar_direction_changed (GtkWidget *widget,
GtkTextDirection direction);
static void gtk_path_bar_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_path_bar_remove (GtkContainer *container,
@ -97,14 +95,15 @@ static void gtk_path_bar_update_button_appearance (GtkPathBar *path_bar,
gboolean current_dir);
static GtkWidget *
get_slider_button (GtkPathBar *path_bar)
get_slider_button (GtkPathBar *path_bar,
GtkArrowType arrow_type)
{
GtkWidget *button;
gtk_widget_push_composite_child ();
button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT));
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (arrow_type, GTK_SHADOW_OUT));
gtk_container_add (GTK_CONTAINER (path_bar), button);
gtk_widget_show_all (button);
@ -120,8 +119,8 @@ gtk_path_bar_init (GtkPathBar *path_bar)
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (path_bar), FALSE);
path_bar->spacing = 3;
path_bar->up_slider_button = get_slider_button (path_bar);
path_bar->down_slider_button = get_slider_button (path_bar);
path_bar->up_slider_button = get_slider_button (path_bar, GTK_ARROW_LEFT);
path_bar->down_slider_button = get_slider_button (path_bar, GTK_ARROW_RIGHT);
path_bar->icon_size = FALLBACK_ICON_SIZE;
g_signal_connect (path_bar->up_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_up), path_bar);
@ -146,7 +145,6 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
widget_class->size_request = gtk_path_bar_size_request;
widget_class->size_allocate = gtk_path_bar_size_allocate;
widget_class->direction_changed = gtk_path_bar_direction_changed;
widget_class->style_set = gtk_path_bar_style_set;
widget_class->screen_changed = gtk_path_bar_screen_changed;
@ -267,30 +265,6 @@ gtk_path_bar_size_request (GtkWidget *widget,
static void
gtk_path_bar_update_slider_buttons (GtkPathBar *path_bar)
{
GtkTextDirection direction;
direction = gtk_widget_get_direction (GTK_WIDGET (path_bar));
if (direction == GTK_TEXT_DIR_RTL)
{
GtkWidget *arrow;
arrow = gtk_bin_get_child (GTK_BIN (path_bar->up_slider_button));
g_object_set (arrow, "arrow_type", GTK_ARROW_RIGHT, NULL);
arrow = gtk_bin_get_child (GTK_BIN (path_bar->down_slider_button));
g_object_set (arrow, "arrow_type", GTK_ARROW_LEFT, NULL);
}
else
{
GtkWidget *arrow;
arrow = gtk_bin_get_child (GTK_BIN (path_bar->up_slider_button));
g_object_set (arrow, "arrow_type", GTK_ARROW_LEFT, NULL);
arrow = gtk_bin_get_child (GTK_BIN (path_bar->down_slider_button));
g_object_set (arrow, "arrow_type", GTK_ARROW_RIGHT, NULL);
}
if (path_bar->button_list)
{
GtkWidget *button;
@ -491,15 +465,6 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
}
}
static void
gtk_path_bar_direction_changed (GtkWidget *widget,
GtkTextDirection direction)
{
gtk_path_bar_update_slider_buttons (GTK_PATH_BAR (widget));
(* GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->direction_changed) (widget, direction);
}
static void
gtk_path_bar_style_set (GtkWidget *widget,
GtkStyle *previous_style)

View File

@ -158,8 +158,6 @@ static void gtk_toolbar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_toolbar_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gtk_toolbar_direction_changed (GtkWidget *widget,
GtkTextDirection previous_direction);
static gboolean gtk_toolbar_focus (GtkWidget *widget,
GtkDirectionType dir);
static void gtk_toolbar_screen_changed (GtkWidget *widget,
@ -373,7 +371,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
widget_class->size_request = gtk_toolbar_size_request;
widget_class->size_allocate = gtk_toolbar_size_allocate;
widget_class->style_set = gtk_toolbar_style_set;
widget_class->direction_changed = gtk_toolbar_direction_changed;
widget_class->focus = gtk_toolbar_focus;
widget_class->screen_changed = gtk_toolbar_screen_changed;
widget_class->realize = gtk_toolbar_realize;
@ -1625,24 +1622,6 @@ gtk_toolbar_style_set (GtkWidget *widget,
gtk_toolbar_update_button_relief (GTK_TOOLBAR (widget));
}
static void
gtk_toolbar_direction_changed (GtkWidget *widget,
GtkTextDirection previous_dir)
{
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
if (toolbar->orientation == GTK_ORIENTATION_VERTICAL)
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
gtk_arrow_set (GTK_ARROW (priv->arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
else
gtk_arrow_set (GTK_ARROW (priv->arrow), GTK_ARROW_LEFT, GTK_SHADOW_NONE);
}
GTK_WIDGET_CLASS (parent_class)->direction_changed (widget, previous_dir);
}
static GList *
gtk_toolbar_list_children_in_focus_order (GtkToolbar *toolbar,
GtkDirectionType dir)
@ -2355,10 +2334,8 @@ gtk_toolbar_orientation_changed (GtkToolbar *toolbar,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_arrow_set (GTK_ARROW (priv->arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE);
else if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_LTR)
else
gtk_arrow_set (GTK_ARROW (priv->arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
else
gtk_arrow_set (GTK_ARROW (priv->arrow), GTK_ARROW_LEFT, GTK_SHADOW_NONE);
gtk_toolbar_reconfigured (toolbar);