Commit 688f7a26 authored by Michael J. Chudobiak's avatar Michael J. Chudobiak
Browse files

Fixed RTL icons and arrow rendering, with newer gtk. Bug 747380.

parent 3dcfc7e2
......@@ -58,7 +58,7 @@ GLIB_GSETTINGS
GTHUMB_EXTENSION_RULES
GLIB_REQUIRED=2.36.0
GTK_REQUIRED=3.10.0
GTK_REQUIRED=3.13.2
EXIV2_REQUIRED=0.21
CLUTTER_REQUIRED=1.12.0
CLUTTER_GTK_REQUIRED=1.0.0
......
......@@ -541,17 +541,15 @@ gth_file_tool_adjust_colors_populate_headerbar (GthFileTool *base,
GthBrowser *browser)
{
GthFileToolAdjustColors *self;
gboolean rtl;
GtkWidget *button;
self = (GthFileToolAdjustColors *) base;
/* reset button */
rtl = gtk_widget_get_direction (GTK_WIDGET (base)) == GTK_TEXT_DIR_RTL;
button = gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS,
rtl ? "edit-undo-rtl-symbolic" : "edit-undo-symbolic",
"edit-undo-symbolic",
_("Reset"),
NULL,
NULL);
......
......@@ -808,17 +808,15 @@ gth_file_tool_curves_populate_headerbar (GthFileTool *base,
GthBrowser *browser)
{
GthFileToolCurves *self;
gboolean rtl;
GtkWidget *button;
self = (GthFileToolCurves *) base;
/* reset button */
rtl = gtk_widget_get_direction (GTK_WIDGET (base)) == GTK_TEXT_DIR_RTL;
button = gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS,
rtl ? "edit-undo-rtl-symbolic" : "edit-undo-symbolic",
"edit-undo-symbolic",
_("Reset"),
NULL,
NULL);
......
......@@ -72,11 +72,8 @@ gth_file_tool_redo_class_init (GthFileToolRedoClass *klass)
static void
gth_file_tool_redo_init (GthFileToolRedo *self)
{
gboolean rtl;
rtl = gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL;
gth_file_tool_construct (GTH_FILE_TOOL (self), rtl ? "edit-redo-rtl-symbolic" :
"edit-redo-symbolic",
_("Redo"), GTH_TOOLBOX_SECTION_FILE);
gth_file_tool_construct (GTH_FILE_TOOL (self),
"edit-redo-symbolic",
_("Redo"),
GTH_TOOLBOX_SECTION_FILE);
}
......@@ -589,17 +589,15 @@ gth_file_tool_rotate_populate_headerbar (GthFileTool *base,
GthBrowser *browser)
{
GthFileToolRotate *self;
gboolean rtl;
GtkWidget *button;
self = (GthFileToolRotate *) base;
/* reset button */
rtl = gtk_widget_get_direction (GTK_WIDGET (base)) == GTK_TEXT_DIR_RTL;
button = gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS,
rtl ? "edit-undo-rtl-symbolic" : "edit-undo-symbolic",
"edit-undo-symbolic",
_("Reset"),
NULL,
NULL);
......
......@@ -351,17 +351,15 @@ gth_file_tool_sharpen_populate_headerbar (GthFileTool *base,
GthBrowser *browser)
{
GthFileToolSharpen *self;
gboolean rtl;
GtkWidget *button;
self = (GthFileToolSharpen *) base;
/* reset button */
rtl = gtk_widget_get_direction (GTK_WIDGET (base)) == GTK_TEXT_DIR_RTL;
button = gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS,
rtl ? "edit-undo-rtl-symbolic" : "edit-undo-symbolic",
"edit-undo-symbolic",
_("Reset"),
NULL,
NULL);
......
......@@ -72,11 +72,8 @@ gth_file_tool_undo_class_init (GthFileToolUndoClass *klass)
static void
gth_file_tool_undo_init (GthFileToolUndo *self)
{
gboolean rtl;
rtl = gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL;
gth_file_tool_construct (GTH_FILE_TOOL (self), rtl ? "edit-undo-rtl-symbolic" :
"edit-undo-symbolic",
_("Undo"), GTH_TOOLBOX_SECTION_FILE);
gth_file_tool_construct (GTH_FILE_TOOL (self),
"edit-undo-symbolic",
_("Undo"),
GTH_TOOLBOX_SECTION_FILE);
}
......@@ -594,13 +594,10 @@ update_play_button (GthMediaViewerPage *self,
}
else if (self->priv->playing && (new_state != GST_STATE_PLAYING)) {
GtkWidget *play_button = GET_WIDGET ("play_button_image");
gboolean rtl;
rtl = gtk_widget_get_direction (play_button) == GTK_TEXT_DIR_RTL;
set_playing_state (self, FALSE);
gtk_image_set_from_icon_name (GTK_IMAGE (play_button),
rtl ? "media-playback-start-rtl-symbolic" : "media-playback-start-symbolic",
"media-playback-start-symbolic",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_set_tooltip_text (GET_WIDGET ("play_button_image"), _("Play"));
......@@ -621,7 +618,6 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
GthBrowser *browser)
{
GthMediaViewerPage *self;
gboolean rtl;
if (! gstreamer_init ())
return;
......@@ -641,8 +637,6 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
"win.video-screenshot",
NULL);
rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
/* video area */
self->priv->area = gtk_drawing_area_new ();
......@@ -706,10 +700,10 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
gtk_widget_set_valign (self->priv->mediabar, GTK_ALIGN_END);
gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("play_slower_image")),
rtl ? "media-seek-backward-rtl-symbolic" : "media-seek-backward-symbolic",
"media-seek-backward-symbolic",
GTK_ICON_SIZE_MENU);
gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("play_faster_image")),
rtl ? "media-seek-forward-rtl-symbolic" : "media-seek-forward-symbolic",
"media-seek-forward-symbolic",
GTK_ICON_SIZE_MENU);
g_signal_connect (GET_WIDGET ("volume_adjustment"),
......
......@@ -2641,6 +2641,9 @@ viewer_container_get_child_position_cb (GtkOverlay *overlay,
GthBrowser *browser = user_data;
GtkAllocation main_alloc;
gboolean allocation_filled = FALSE;
gboolean rtl;
rtl = gtk_widget_get_direction (GTK_WIDGET (overlay)) == GTK_TEXT_DIR_RTL;
gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (overlay)), &main_alloc);
gtk_widget_get_preferred_width (widget, NULL, &allocation->width);
......@@ -2652,12 +2655,14 @@ viewer_container_get_child_position_cb (GtkOverlay *overlay,
allocation_filled = TRUE;
}
else if (widget == browser->priv->previous_image_button) {
allocation->x = OVERLAY_MARGIN;
allocation->x = rtl ? main_alloc.width - allocation->width - OVERLAY_MARGIN :
OVERLAY_MARGIN;
allocation->y = (main_alloc.height - allocation->height) / 2;
allocation_filled = TRUE;
}
else if (widget == browser->priv->next_image_button) {
allocation->x = main_alloc.width - allocation->width - OVERLAY_MARGIN;
allocation->x = rtl ? OVERLAY_MARGIN :
main_alloc.width - allocation->width - OVERLAY_MARGIN;
allocation->y = (main_alloc.height - allocation->height) / 2;
allocation_filled = TRUE;
}
......@@ -4385,15 +4390,12 @@ gth_browser_init (GthBrowser *browser)
{
GtkWidget *header_bar;
gboolean rtl;
GtkBuilder *builder;
GMenuModel *menu;
GtkWidget *button;
header_bar = gth_window_get_header_bar (GTH_WINDOW (browser));
rtl = gtk_widget_get_direction (header_bar) == GTK_TEXT_DIR_RTL;
gtk_widget_set_margin_left (browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
gtk_widget_set_margin_right (browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
gtk_widget_set_margin_left (browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
......@@ -4460,13 +4462,13 @@ gth_browser_init (GthBrowser *browser)
gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_BROWSER_NAVIGATION,
rtl ? "go-previous-rtl-symbolic" : "go-previous-symbolic",
"go-previous-symbolic",
_("Go to the previous visited location"),
"win.go-back",
NULL);
gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_BROWSER_NAVIGATION,
rtl ? "go-next-rtl-symbolic" : "go-next-symbolic",
"go-next-symbolic",
_("Go to the next visited location"),
"win.go-forward",
NULL);
......@@ -4489,7 +4491,7 @@ gth_browser_init (GthBrowser *browser)
gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_VIEWER_NAVIGATION,
rtl ? "go-previous-rtl-symbolic" : "go-previous-symbolic",
"go-previous-symbolic",
_("View the folders"),
"win.browser-mode",
NULL);
......@@ -4513,7 +4515,7 @@ gth_browser_init (GthBrowser *browser)
gth_browser_add_header_bar_button (browser,
GTH_BROWSER_HEADER_SECTION_EDITOR_NAVIGATION,
rtl ? "go-previous-rtl-symbolic" : "go-previous-symbolic",
"go-previous-symbolic",
NULL,
"win.browser-mode",
NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment