diff options
Diffstat (limited to 'src/gui/widgets/shortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/shortcutcontainer.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index e789c863d..313e37262 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -23,9 +23,12 @@ #include "gui/widgets/shortcutcontainer.h" #include "graphicsvertexes.h" +#include "settings.h" #include "gui/gui.h" +#include "resources/image.h" + #include "utils/delete2.h" #include "debug.h" @@ -45,10 +48,37 @@ ShortcutContainer::ShortcutContainer(Widget2 *const widget) : mVertexes(new ImageCollection) { mAllowLogic = false; + + addMouseListener(this); + addWidgetListener(this); + + mForegroundColor = getThemeColor(Theme::TEXT); + mForegroundColor2 = getThemeColor(Theme::TEXT_OUTLINE); + + mBackgroundImg = Theme::getImageFromThemeXml( + "item_shortcut_background.xml", "background.xml"); + + if (mBackgroundImg) + { + mBackgroundImg->setAlpha(settings.guiAlpha); + mBoxHeight = mBackgroundImg->getHeight(); + mBoxWidth = mBackgroundImg->getWidth(); + } + else + { + mBoxHeight = 1; + mBoxWidth = 1; + } } ShortcutContainer::~ShortcutContainer() { + if (mBackgroundImg) + { + mBackgroundImg->decRef(); + mBackgroundImg = nullptr; + } + if (gui) gui->removeDragged(this); |