summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-21 19:29:13 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-21 23:18:46 +0300
commitcff8c1925f426dafaeb32def5fc56f170bafba39 (patch)
tree7e1d61db0d795e7d810124112f3f461b3755b3a4 /src
parentb1e41be0a3f87f42f8bab2416a8f1ce432f95fe2 (diff)
downloadmanaplus-cff8c1925f426dafaeb32def5fc56f170bafba39.tar.gz
manaplus-cff8c1925f426dafaeb32def5fc56f170bafba39.tar.bz2
manaplus-cff8c1925f426dafaeb32def5fc56f170bafba39.tar.xz
manaplus-cff8c1925f426dafaeb32def5fc56f170bafba39.zip
Improve shortcutswindow class.
Diffstat (limited to 'src')
-rw-r--r--src/gui/shortcutwindow.cpp8
-rw-r--r--src/gui/shortcutwindow.h7
2 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp
index 6f00e36c2..ef893c1ba 100644
--- a/src/gui/shortcutwindow.cpp
+++ b/src/gui/shortcutwindow.cpp
@@ -54,7 +54,7 @@ class ShortcutTab final : public Tab
ShortcutWindow::ShortcutWindow(const std::string &title,
ShortcutContainer *const content,
- std::string skinFile,
+ const std::string &skinFile,
int width, int height) :
Window("Window", false, nullptr, skinFile),
mItems(content),
@@ -104,7 +104,8 @@ ShortcutWindow::ShortcutWindow(const std::string &title,
enableVisibleSound(true);
}
-ShortcutWindow::ShortcutWindow(const std::string &title, std::string skinFile,
+ShortcutWindow::ShortcutWindow(const std::string &title,
+ const std::string &skinFile,
const int width, const int height) :
Window("Window", false, nullptr, skinFile),
mItems(nullptr),
@@ -152,7 +153,8 @@ ShortcutWindow::~ShortcutWindow()
mItems = nullptr;
}
-void ShortcutWindow::addTab(std::string name, ShortcutContainer *const content)
+void ShortcutWindow::addTab(const std::string &name,
+ ShortcutContainer *const content)
{
ScrollArea *const scroll = new ScrollArea(content, false);
scroll->setPosition(SCROLL_PADDING, SCROLL_PADDING);
diff --git a/src/gui/shortcutwindow.h b/src/gui/shortcutwindow.h
index 5242fca2f..530a272e3 100644
--- a/src/gui/shortcutwindow.h
+++ b/src/gui/shortcutwindow.h
@@ -42,10 +42,11 @@ class ShortcutWindow final : public Window
*/
ShortcutWindow(const std::string &title,
ShortcutContainer *const content,
- std::string skinFile = "",
+ const std::string &skinFile = "",
int width = 0, int height = 0);
- ShortcutWindow(const std::string &title, std::string skinFile = "",
+ ShortcutWindow(const std::string &title,
+ const std::string &skinFile = "",
const int width = 0, const int height = 0);
A_DELETE_COPY(ShortcutWindow)
@@ -55,7 +56,7 @@ class ShortcutWindow final : public Window
*/
~ShortcutWindow();
- void addTab(std::string name, ShortcutContainer *const content);
+ void addTab(const std::string &name, ShortcutContainer *const content);
int getTabIndex() const A_WARN_UNUSED;