From edb6c09c64e2a4f9f4fa3d48c0521e2b2e464101 Mon Sep 17 00:00:00 2001 From: Juanjo Date: Sat, 19 Oct 2013 11:47:55 +0000 Subject: [PATCH] When in touchscreen modes, windows aligned with main toolbar are aligned to the left/right edge of the screen. --- src/window.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index cad3e3ca31..1b357a5f69 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1655,7 +1655,13 @@ Point GetToolbarAlignedWindowPosition(int window_width) { const Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0); assert(w != NULL); - Point pt = { _current_text_dir == TD_RTL ? w->left : (w->left + w->width) - window_width, w->top + w->height }; + Point pt; + pt.y = w->top + w->height; + if (_settings_client.gui.touchscreen_mode != TSC_NONE) { + pt.x = _current_text_dir == TD_RTL ? 0 : (_screen.width - window_width); + } else { + pt.x = _current_text_dir == TD_RTL ? w->left : (w->left + w->width) - window_width; + } return pt; }