From 99a338132bc28668f9e3ce2aca946474232bd1bc Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 23 May 2008 08:09:51 +0000 Subject: [PATCH] left-align the labels in the new dynamics matrix. Add some code for RTL 2008-05-23 Michael Natterer * app/tools/gimppaintoptions-gui.c: left-align the labels in the new dynamics matrix. Add some code for RTL layout that doesn't work properly yet. svn path=/trunk/; revision=25772 --- ChangeLog | 6 ++++++ app/tools/gimppaintoptions-gui.c | 31 +++++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 040448eb99..42213a26a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-23 Michael Natterer + + * app/tools/gimppaintoptions-gui.c: left-align the labels in the + new dynamics matrix. Add some code for RTL layout that doesn't + work properly yet. + 2008-05-22 Michael Natterer * app/paint/gimpbrushcore.c (gimp_brush_core_interpolate): move diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c index 02474560a1..0ce3686bf2 100644 --- a/app/tools/gimppaintoptions-gui.c +++ b/app/tools/gimppaintoptions-gui.c @@ -201,6 +201,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options) GtkWidget *inner_frame; GtkWidget *fixed; gint i; + gboolean rtl = gtk_widget_get_direction (vbox) == GTK_TEXT_DIR_RTL; frame = gimp_prop_expander_new (config, "dynamics-expanded", _("Dynamics sensitivity")); @@ -216,32 +217,32 @@ gimp_paint_options_gui (GimpToolOptions *tool_options) gtk_widget_show (table); label = gtk_label_new (_("Pressure:")); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 1, 2, + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); label = gtk_label_new (_("Velocity:")); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 2, 3, + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); label = gtk_label_new (_("Random:")); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 3, 4, + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (label); fixed = gtk_fixed_new (); - gtk_table_attach (GTK_TABLE (table), fixed, - 0, 6, 0, 1, + gtk_table_attach (GTK_TABLE (table), fixed, 0, 6, 0, 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (fixed); for (i = 0; i < n_dynamics; i++) { - gtk_label_set_angle (GTK_LABEL (dynamics_labels[i]), 315); + gtk_label_set_angle (GTK_LABEL (dynamics_labels[i]), + rtl ? 45 : 315); gtk_misc_set_alignment (GTK_MISC (dynamics_labels[i]), 1.0, 1.0); gtk_fixed_put (GTK_FIXED (fixed), dynamics_labels[i], 0, 0); gtk_widget_show (dynamics_labels[i]); @@ -396,9 +397,15 @@ dynamics_check_button_size_allocate (GtkWidget *toggle, GtkWidget *label) { GtkWidget *fixed = label->parent; - gint x = (allocation->x + allocation->width - - label->allocation.width - fixed->allocation.x); - gint y = (fixed->allocation.height - label->allocation.height); + gint x, y; + + if (gtk_widget_get_direction (label) == GTK_TEXT_DIR_LTR) + x = (allocation->x + allocation->width - + label->allocation.width - fixed->allocation.x); + else + x = allocation->x + fixed->allocation.x; + + y = (fixed->allocation.height - label->allocation.height); gtk_fixed_move (GTK_FIXED (fixed), label, x, y); }