From ef36b80dfa120edb4648b3f1f7409fc858ba4712 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 15 Jun 2010 10:50:28 +0000 Subject: [PATCH] GUI: Implement FR #2821514. FR #2821514: "GUI: OK and Cancel buttons in option tabs". Now tabs are visually separated from the buttons. svn-id: r49770 --- gui/TabWidget.cpp | 14 +++++++++++--- gui/TabWidget.h | 3 +++ gui/themes/default.inc | 6 ++++++ gui/themes/scummclassic.zip | Bin 55015 -> 55147 bytes gui/themes/scummclassic/classic_layout.stx | 3 +++ .../scummclassic/classic_layout_lowres.stx | 3 +++ gui/themes/scummmodern.zip | Bin 162447 -> 162581 bytes gui/themes/scummmodern/scummmodern_layout.stx | 5 +++++ .../scummmodern/scummmodern_layout_lowres.stx | 3 +++ 9 files changed, 34 insertions(+), 3 deletions(-) diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp index 691eebf0339..275e3613b57 100644 --- a/gui/TabWidget.cpp +++ b/gui/TabWidget.cpp @@ -37,12 +37,12 @@ enum { }; TabWidget::TabWidget(GuiObject *boss, int x, int y, int w, int h) - : Widget(boss, x, y, w, h) { + : Widget(boss, x, y, w, h), _bodyBackgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) { init(); } TabWidget::TabWidget(GuiObject *boss, const String &name) - : Widget(boss, name) { + : Widget(boss, name), _bodyBackgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) { init(); } @@ -56,7 +56,12 @@ void TabWidget::init() { _tabHeight = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Height"); _titleVPad = g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Padding.Top"); - _butRP = g_gui.xmlEval()->getVar("Globals.TabWidget.navButtonPadding.Right", 0); + _bodyTP = g_gui.xmlEval()->getVar("Globals.TabWidget.Body.Padding.Top"); + _bodyBP = g_gui.xmlEval()->getVar("Globals.TabWidget.Body.Padding.Bottom"); + _bodyLP = g_gui.xmlEval()->getVar("Globals.TabWidget.Body.Padding.Left"); + _bodyRP = g_gui.xmlEval()->getVar("Globals.TabWidget.Body.Padding.Right"); + + _butRP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButtonPadding.Right", 0); _butTP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Padding.Top", 0); _butW = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Width", 10); _butH = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Height", 10); @@ -279,11 +284,14 @@ void TabWidget::drawWidget() { for (int i = _firstVisibleTab; i < (int)_tabs.size(); ++i) { tabs.push_back(_tabs[i].title); } + g_gui.theme()->drawDialogBackground(Common::Rect(_x + _bodyLP, _y + _bodyTP, _x+_w-_bodyRP, _y+_h-_bodyBP), _bodyBackgroundType); + g_gui.theme()->drawTab(Common::Rect(_x, _y, _x+_w, _y+_h), _tabHeight, _tabWidth, tabs, _activeTab - _firstVisibleTab, 0, _titleVPad); } void TabWidget::draw() { Widget::draw(); + if (_tabWidth * _tabs.size() > _w) { _navLeft->draw(); _navRight->draw(); diff --git a/gui/TabWidget.h b/gui/TabWidget.h index 81544c2de74..e7b8733d8fb 100644 --- a/gui/TabWidget.h +++ b/gui/TabWidget.h @@ -46,6 +46,9 @@ protected: int _tabWidth; int _tabHeight; + int _bodyRP, _bodyTP, _bodyLP, _bodyBP; + ThemeEngine::DialogBackground _bodyBackgroundType; + int _titleVPad; int _butRP, _butTP, _butW, _butH; diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 636e7f4ff05..17294703f43 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -469,6 +469,9 @@ "size='75,27' " "padding='0,0,8,0' " "/> " +" " " " +" " "u+|?m5 z*>)1=>{?M7`gKER%>z0hRJ#j(qaMLtZX1*76ulEp9~BPG1owf0CN*PxBvhE delta 127 zcmaF8j`{go<_!-ud24&l*?6;@Tf-g3z`(uvohAp@W(yNFAKspxb2bMvrd;n2Wnk#v zoZWDObFzhr_~xE2KOa;*lb>HRRzOi5%D^DWfB;Jxg&HOoG)PYly)M9Z<0?o30BCM4 AGynhq diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index be4a6e2638b..9f241c06e51 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -88,6 +88,9 @@ size = '75, 27' padding = '0, 0, 8, 0' /> + + !0>weK^dm`oLp#{r(38pNq{wOk5^-g59UR2%=FWhOy=?^#)L62$TA?n clE!z_6|0!Mm_$mZ=Tt_jxYuWSq21H(zr^7X*#zo ulic* + + + +