From 3cb6c7d5ee882627e9c1eb5fcccf5759f221577e Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 3 Jun 2014 21:55:41 +0300 Subject: [PATCH] Fixed right toolbar moving to the left, removed remainder of 'touchscreen mode' stuff --- src/settings.cpp | 6 ------ src/settings_type.h | 1 - src/table/settings.ini | 1 - src/toolbar_gui.h | 2 -- src/toolbar_type.h | 24 ------------------------ src/window.cpp | 10 ++++++++-- 6 files changed, 8 insertions(+), 36 deletions(-) delete mode 100644 src/toolbar_type.h diff --git a/src/settings.cpp b/src/settings.cpp index 0142d502b0..5d65795107 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1081,12 +1081,6 @@ static bool VerticalToolbarChanged(int32 p1) return true; } -static bool TouchscreenModeChanged(int32 p1) -{ - //ResetTabletWindow(); - return true; -} - /** * Update any possible saveload window and delete any newgrf dialogue as * its widget parts might change. Reinit all windows as it allows access to the diff --git a/src/settings_type.h b/src/settings_type.h index 6a9752c991..235b7bebc7 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -21,7 +21,6 @@ #include "linkgraph/linkgraph_type.h" #include "zoom_type.h" #include "openttd.h" -#include "toolbar_type.h" /** Settings profiles and highscore tables. */ diff --git a/src/table/settings.ini b/src/table/settings.ini index 4a1036aea4..478f6abf9e 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -41,7 +41,6 @@ static bool InvalidateCompanyInfrastructureWindow(int32 p1); static bool InvalidateCompanyWindow(int32 p1); static bool ZoomMinMaxChanged(int32 p1); static bool VerticalToolbarChanged(int32 p1); -static bool TouchscreenModeChanged(int32 p1); #ifdef ENABLE_NETWORK static bool UpdateClientName(int32 p1); diff --git a/src/toolbar_gui.h b/src/toolbar_gui.h index 3461c22902..1ad147b3f2 100644 --- a/src/toolbar_gui.h +++ b/src/toolbar_gui.h @@ -16,8 +16,6 @@ void AllocateToolbar(); void ToggleBoundingBoxes(); void ToggleDirtyBlocks(); -void ResetTabletWindow(); - extern int _last_clicked_toolbar_idx; #endif /* TOOLBAR_GUI_H */ diff --git a/src/toolbar_type.h b/src/toolbar_type.h deleted file mode 100644 index 682cf2f568..0000000000 --- a/src/toolbar_type.h +++ /dev/null @@ -1,24 +0,0 @@ -/* $Id$ */ - -/* - * This file is part of OpenTTD. - * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. - * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . - */ - -/** @file toolbar_type.h Types related to toolbars. */ - -#ifndef TOOLBAR_TYPE_H -#define TOOLBAR_TYPE_H - -/** Types of touchscreen modes. */ -enum TouchscreenMode { - TSC_NONE = 0, - TSC_SIMPLE, - TSC_CONFIRM, -}; -DECLARE_CYCLE(TouchscreenMode, TSC_NONE, TSC_CONFIRM) -typedef SimpleTinyEnumT TouchscreenModeByte; - -#endif /* TOOLBAR_TYPE_H */ diff --git a/src/window.cpp b/src/window.cpp index 6a619edae5..67cc604332 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3449,7 +3449,7 @@ static int PositionWindow(Window *w, WindowClass clss, int setting) */ int PositionMainToolbar(Window *w) { - if (_settings_client.gui.vertical_toolbar) return 0; + if (_settings_client.gui.vertical_toolbar) return 0; /* Always at the left */ DEBUG(misc, 5, "Repositioning Main Toolbar..."); return PositionWindow(w, WC_MAIN_TOOLBAR, _settings_client.gui.toolbar_pos); } @@ -3525,13 +3525,19 @@ void RelocateAllWindows(int neww, int newh) continue; case WC_MAIN_TOOLBAR: - case WC_MAIN_TOOLBAR_RIGHT: ResizeWindow(w, min(neww, w->window_desc->default_width) - w->width, 0, false); top = w->top; left = PositionMainToolbar(w); // changes toolbar orientation break; + case WC_MAIN_TOOLBAR_RIGHT: + ResizeWindow(w, min(neww, w->window_desc->default_width) - w->width, 0, false); + + top = w->top; + left = neww - w->width; + break; + case WC_NEWS_WINDOW: top = newh - w->height; left = PositionNewsMessage(w);