Fixed right toolbar moving to the left, removed remainder of 'touchscreen mode' stuff

This commit is contained in:
Sergii Pylypenko
2014-06-03 21:55:41 +03:00
parent 75c376a23e
commit 3cb6c7d5ee
6 changed files with 8 additions and 36 deletions

View File

@@ -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

View File

@@ -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. */

View File

@@ -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);

View File

@@ -16,8 +16,6 @@ void AllocateToolbar();
void ToggleBoundingBoxes();
void ToggleDirtyBlocks();
void ResetTabletWindow();
extern int _last_clicked_toolbar_idx;
#endif /* TOOLBAR_GUI_H */

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
/** @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<TouchscreenMode, byte> TouchscreenModeByte;
#endif /* TOOLBAR_TYPE_H */

View File

@@ -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);