summaryrefslogtreecommitdiff
path: root/src/gui/setup_chat.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-08 02:17:40 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-08 02:17:40 +0300
commitbe881476350ab5f4202e687ad4161099870fe5a4 (patch)
tree0758102d5203de8857be71b9d8ef6b3eeccff3fb /src/gui/setup_chat.cpp
parentb65ec0190a8b5623052981b841ce2232b27760ef (diff)
downloadmv-be881476350ab5f4202e687ad4161099870fe5a4.tar.gz
mv-be881476350ab5f4202e687ad4161099870fe5a4.tar.bz2
mv-be881476350ab5f4202e687ad4161099870fe5a4.tar.xz
mv-be881476350ab5f4202e687ad4161099870fe5a4.zip
Now if chat input is hidden, it not using space in window.
Diffstat (limited to 'src/gui/setup_chat.cpp')
-rw-r--r--src/gui/setup_chat.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/setup_chat.cpp b/src/gui/setup_chat.cpp
index f666284d6..a5b211d8f 100644
--- a/src/gui/setup_chat.cpp
+++ b/src/gui/setup_chat.cpp
@@ -54,6 +54,7 @@
#define ACTION_SHOW_CHAT_HISTORY "show chat history"
#define ACTION_ENABLE_BATTLE_TAB "show battle tab"
#define ACTION_SHOW_BATTLE_EVENTS "show battle events"
+#define ACTION_RESIZE_CHAT "resize chat"
Setup_Chat::Setup_Chat() :
mEditDialog(0)
@@ -127,6 +128,10 @@ Setup_Chat::Setup_Chat() :
mMaxLinesField = new IntTextField(maxLinesLimit, 0, 500, mMaxLines, 20);
+ mHideChatInput = config.getBoolValue("hideChatInput");
+ mHideChatInputCheckBox = new CheckBox(_("Resize chat tabs if need"),
+ mHideChatInput, this, ACTION_RESIZE_CHAT);
+
// Do the layout
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
@@ -148,6 +153,7 @@ Setup_Chat::Setup_Chat() :
place(0, 10, mShowChatHistoryCheckBox, 10);
place(0, 11, mEnableBattleTabCheckBox, 10);
place(0, 12, mShowBattleEventsCheckBox, 10);
+ place(0, 13, mHideChatInputCheckBox, 10);
place.getCell().matchColWidth(0, 0);
place = h.getPlacer(0, 1);
@@ -232,6 +238,10 @@ void Setup_Chat::action(const gcn::ActionEvent &event)
{
mShowBattleEvents = mShowBattleEventsCheckBox->isSelected();
}
+ else if (event.getId() == ACTION_RESIZE_CHAT)
+ {
+ mHideChatInput = mHideChatInputCheckBox->isSelected();
+ }
}
void Setup_Chat::cancel()
@@ -281,6 +291,9 @@ void Setup_Chat::cancel()
mShowBattleEvents = config.getBoolValue("showBattleEvents");
mShowBattleEventsCheckBox->setSelected(mShowBattleEvents);
+
+ mHideChatInput = config.getBoolValue("hideChatInput");
+ mHideChatInputCheckBox->setSelected(mHideChatInput);
}
void Setup_Chat::apply()
@@ -304,4 +317,8 @@ void Setup_Chat::apply()
config.setValue("showChatHistory", mShowChatHistory);
config.setValue("enableBattleTab", mEnableBattleTab);
config.setValue("showBattleEvents", mShowBattleEvents);
+
+ config.setValue("hideChatInput", mHideChatInput);
+ if (chatWindow)
+ chatWindow->adjustTabSize();
}