[gnome-builder/gnome-builder-3-20] dock-bin: tweak handle position for ltr/rtl
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-20] dock-bin: tweak handle position for ltr/rtl
- Date: Tue, 10 May 2016 11:07:17 +0000 (UTC)
commit 98f93210a0f7b9c70b3b904be6550edc4c266910
Author: Christian Hergert <chergert redhat com>
Date: Tue May 10 14:06:34 2016 +0300
dock-bin: tweak handle position for ltr/rtl
We might need a bit more access to get to scrollbars in common cases, so
adjust for that.
contrib/pnl/pnl-dock-bin.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/contrib/pnl/pnl-dock-bin.c b/contrib/pnl/pnl-dock-bin.c
index 34f5498..0584b4c 100644
--- a/contrib/pnl/pnl-dock-bin.c
+++ b/contrib/pnl/pnl-dock-bin.c
@@ -711,12 +711,28 @@ pnl_dock_bin_child_size_allocate (PnlDockBin *self,
switch (child->type)
{
case PNL_DOCK_BIN_CHILD_LEFT:
- handle_alloc.x += handle_alloc.width - HANDLE_WIDTH;
- handle_alloc.width = HANDLE_WIDTH;
+ /*
+ * When left-to-right, we often have a scrollbar to deal
+ * with right here. So fudge the allocation position a bit
+ * to the right so that the scrollbar can still be easily
+ * hovered.
+ */
+ if (gtk_widget_get_direction (child->widget) == GTK_TEXT_DIR_LTR)
+ {
+ handle_alloc.x += handle_alloc.width - (HANDLE_WIDTH / 2);
+ handle_alloc.width = HANDLE_WIDTH;
+ }
+ else
+ {
+ handle_alloc.x += handle_alloc.width - HANDLE_WIDTH;
+ handle_alloc.width = HANDLE_WIDTH;
+ }
break;
case PNL_DOCK_BIN_CHILD_RIGHT:
handle_alloc.width = HANDLE_WIDTH;
+ if (gtk_widget_get_direction (child->widget) == GTK_TEXT_DIR_RTL)
+ handle_alloc.x -= (HANDLE_WIDTH / 2);
break;
case PNL_DOCK_BIN_CHILD_BOTTOM:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]