aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-01-24 03:06:47 +0100
committerJohannes Schickel2016-01-24 03:06:47 +0100
commit83df1eb43be7c4fa5cc14d743f91c507d905c564 (patch)
tree82aa465064af0926a4f1af901c6feec2fc610b39
parent4a092eeb64fa23376327cea91350fb15028ed777 (diff)
downloadscummvm-rg350-83df1eb43be7c4fa5cc14d743f91c507d905c564.tar.gz
scummvm-rg350-83df1eb43be7c4fa5cc14d743f91c507d905c564.tar.bz2
scummvm-rg350-83df1eb43be7c4fa5cc14d743f91c507d905c564.zip
GUI: Only use image for delete when applicable in PredictiveDialog.
-rw-r--r--gui/ThemeEngine.h2
-rw-r--r--gui/predictivedialog.cpp30
-rw-r--r--gui/predictivedialog.h2
-rw-r--r--gui/themes/default.inc2
-rw-r--r--gui/themes/scummclassic.zipbin111302 -> 111410 bytes
-rw-r--r--gui/themes/scummclassic/THEMERC2
-rw-r--r--gui/themes/scummclassic/classic_layout.stx1
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx1
-rw-r--r--gui/themes/scummmodern.zipbin1487079 -> 1487187 bytes
-rw-r--r--gui/themes/scummmodern/THEMERC2
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx1
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx1
12 files changed, 37 insertions, 7 deletions
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 68be2e0b26..7acf830f76 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -36,7 +36,7 @@
#include "graphics/pixelformat.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.20"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.21"
class OSystem;
diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index ee8973bc62..402bf0c06b 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -24,6 +24,7 @@
#include "gui/widget.h"
#include "gui/widgets/edittext.h"
#include "gui/gui-manager.h"
+#include "gui/ThemeEval.h"
#include "common/config-manager.h"
#include "common/translation.h"
@@ -89,11 +90,13 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
_btns[kAddAct]->setEnabled(false);
#ifndef DISABLE_FANCY_THEMES
- _btns[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd);
- ((PicButtonWidget *)_btns[kDelAct])->useThemeTransparency(true);
- ((PicButtonWidget *)_btns[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelbtn));
+ if (g_gui.xmlEval()->getVar("Globals.Predictive.ShowDeletePic") == 1 && g_gui.theme()->supportsImages()) {
+ _btns[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd);
+ ((PicButtonWidget *)_btns[kDelAct])->useThemeTransparency(true);
+ ((PicButtonWidget *)_btns[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelbtn));
+ } else
#endif
- _btns[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
+ _btns[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
// I18N: Pre means 'Predictive', leave '*' as is
_btns[kModeAct] = new ButtonWidget(this, "Predictive.Pre", _("* Pre"), 0, kModeCmd);
_edittext = new EditTextWidget(this, "Predictive.Word", _search, 0, 0, 0);
@@ -171,6 +174,25 @@ PredictiveDialog::~PredictiveDialog() {
free(_btns);
}
+void PredictiveDialog::reflowLayout() {
+#ifndef DISABLE_FANCY_THEMES
+ removeWidget(_btns[kDelAct]);
+ _btns[kDelAct]->setNext(0);
+ delete _btns[kDelAct];
+ _btns[kDelAct] = nullptr;
+
+ if (g_gui.xmlEval()->getVar("Globals.Predictive.ShowDeletePic") == 1 && g_gui.theme()->supportsImages()) {
+ _btns[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd);
+ ((PicButtonWidget *)_btns[kDelAct])->useThemeTransparency(true);
+ ((PicButtonWidget *)_btns[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelbtn));
+ } else {
+ _btns[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
+ }
+#endif
+
+ Dialog::reflowLayout();
+}
+
void PredictiveDialog::saveUserDictToFile() {
if (_userDictHasChanged) {
ConfMan.registerDefault("user_dictionary", "user.dic");
diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h
index 32d769d6ca..7f9b31e2d3 100644
--- a/gui/predictivedialog.h
+++ b/gui/predictivedialog.h
@@ -68,6 +68,8 @@ public:
PredictiveDialog();
~PredictiveDialog();
+ virtual void reflowLayout();
+
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleKeyUp(Common::KeyState state);
virtual void handleKeyDown(Common::KeyState state);
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 90d7967bc0..e367bcb3c7 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -633,6 +633,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<def var='Tooltip.XDelta' value='16'/> "
"<def var='Tooltip.YDelta' value='16'/>"
"<def var='Predictive.Button.Width' value='60' />"
+"<def var='Predictive.ShowDeletePic' value='0'/>"
"<widget name='OptionsLabel' "
"size='110,Globals.Line.Height' "
"textalign='right' "
@@ -1920,6 +1921,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<def var='Tooltip.YDelta' value='8'/>"
"<def var='Predictive.Button.Width' value='45' />"
"<def var='Predictive.Button.Height' value='15' />"
+"<def var='Predictive.ShowDeletePic' value='0'/>"
"<widget name='Button' "
"size='72,16' "
"/>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index d7016cab58..1d8b8dad05 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 8f40cb2a7e..7e58285d08 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.20:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.21:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 26656deaf9..18c2a1f889 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -49,6 +49,7 @@
<def var = 'Tooltip.YDelta' value = '16'/>
<def var = 'Predictive.Button.Width' value = '60' />
+ <def var = 'Predictive.ShowDeletePic' value = '0'/>
<widget name = 'OptionsLabel'
size = '110, Globals.Line.Height'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 60057fa4ba..6cc9eed6b3 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -51,6 +51,7 @@
<def var = 'Predictive.Button.Width' value = '45' />
<def var = 'Predictive.Button.Height' value = '15' />
+ <def var = 'Predictive.ShowDeletePic' value = '0'/>
<widget name = 'Button'
size = '72, 16'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 5bf1b8e17d..43826abf5e 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index f4304622cb..dc98bdc00e 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.20:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.21:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 3254049c62..fd6a3c5cd2 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -56,6 +56,7 @@
<def var = 'Tooltip.YDelta' value = '32'/>
<def var = 'Predictive.Button.Width' value = '60' />
+ <def var = 'Predictive.ShowDeletePic' value = '1'/>
<widget name = 'OptionsLabel'
size = '115, Globals.Line.Height'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 2b4dc099a0..9d8f79795c 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -41,6 +41,7 @@
<def var = 'Predictive.Button.Width' value = '45' />
<def var = 'Predictive.Button.Height' value = '15' />
+ <def var = 'Predictive.ShowDeletePic' value = '0'/>
<widget name = 'Button'
size = '72, 16'