diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-05-21 23:53:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-05-22 00:51:53 +0300 |
commit | 1a8cf63488d8d6f4be297e753c31eea730ece226 (patch) | |
tree | 7e4050bdcd07e417d1c597c6c671c579c1d9256b /src/gui/widgets | |
parent | 3363acba6f1e8e51937ae2e354a8086c5c56b8cd (diff) | |
download | ManaVerse-1a8cf63488d8d6f4be297e753c31eea730ece226.tar.gz ManaVerse-1a8cf63488d8d6f4be297e753c31eea730ece226.tar.bz2 ManaVerse-1a8cf63488d8d6f4be297e753c31eea730ece226.tar.xz ManaVerse-1a8cf63488d8d6f4be297e753c31eea730ece226.zip |
Add option for show shortcuts buttons icons.
Icons by Guaritore.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/button.cpp | 16 | ||||
-rw-r--r-- | src/gui/widgets/button.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_misc.cpp | 5 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 7c4668126..34112e5a5 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -375,6 +375,22 @@ void Button::loadImage(const std::string &imageName) mImages[f] = image; } +void Button::setImage(Image *const image) +{ + if (image == nullptr) + return; + if (mImageSet != nullptr) + { + mImageSet->decRef(); + mImageSet = nullptr; + } + mImageWidth = image->getWidth(); + mImageHeight = image->getHeight(); + mImages = new Image*[BUTTON_COUNT]; + for (int f = 0; f < BUTTON_COUNT; f ++) + mImages[f] = image; +} + void Button::loadImageSet(const std::string &imageName) { if (mImageSet != nullptr) diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index a14a1a5a1..5f8c9e2ba 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -192,6 +192,8 @@ class Button final : public Widget, void loadImageSet(const std::string &imageName); + void setImage(Image *const image); + void adjustSize(); void keyPressed(KeyEvent &event) override final; diff --git a/src/gui/widgets/tabs/setup_misc.cpp b/src/gui/widgets/tabs/setup_misc.cpp index 27d5d0ba3..408184311 100644 --- a/src/gui/widgets/tabs/setup_misc.cpp +++ b/src/gui/widgets/tabs/setup_misc.cpp @@ -426,6 +426,11 @@ Setup_Misc::Setup_Misc(const Widget2 *const widget) : "autohideButtonsEvent", mShortcutsList, 200, MainConfig_true); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Show icons on shortcut buttons"), "", + "showButtonIcons", this, "showButtonIconsEvent", + MainConfig_true); + // TRANSLATORS: settings group new SetupItemLabel(_("Proxy server"), "", this, |