summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/buysell.cpp5
-rw-r--r--src/gui/buysell.h2
-rw-r--r--src/gui/chat.cpp6
-rw-r--r--src/gui/chat.h6
-rw-r--r--src/gui/help.cpp13
-rw-r--r--src/gui/setup.cpp2
-rw-r--r--src/gui/window.h2
7 files changed, 27 insertions, 9 deletions
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp
index 2022b040..4ac06220 100644
--- a/src/gui/buysell.cpp
+++ b/src/gui/buysell.cpp
@@ -49,9 +49,10 @@ BuySellDialog::BuySellDialog(Network *network):
}
buyButton->requestFocus();
- setContentSize(x, 2 * y + buyButton->getHeight());
+ setDefaultSize(x + getPadding(), (2 * y + buyButton->getHeight() +
+ getTitleBarHeight()), ImageRect::CENTER);
- setLocationRelativeTo(ImageRect::CENTER);
+ loadWindowState();
requestFocus();
}
diff --git a/src/gui/buysell.h b/src/gui/buysell.h
index 747066a7..0842c0e1 100644
--- a/src/gui/buysell.h
+++ b/src/gui/buysell.h
@@ -54,4 +54,6 @@ class BuySellDialog : public Window, public gcn::ActionListener
Network *mNetwork;
};
+extern BuySellDialog *buySellDialog;
+
#endif
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 44e08052..5ff9ed46 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -113,6 +113,12 @@ ChatWindow::~ChatWindow()
delete mParty;
}
+void ChatWindow::resetToDefaultSize()
+{
+ mRecorder->resetToDefaultSize();
+ Window::resetToDefaultSize();
+}
+
void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord)
{
// Trim whitespace
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 28408b93..8b710dc8 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -120,6 +120,12 @@ class ChatWindow : public Window, public gcn::ActionListener,
~ChatWindow();
/**
+ * Reset the chat window and recorder window attached to it to their
+ * default positions.
+ */
+ void resetToDefaultSize();
+
+ /**
* Adds a line of text to our message list. Parameters:
*
* @param line Text message.
diff --git a/src/gui/help.cpp b/src/gui/help.cpp
index fec39199..0974abf7 100644
--- a/src/gui/help.cpp
+++ b/src/gui/help.cpp
@@ -40,16 +40,17 @@ HelpWindow::HelpWindow():
setWindowName(_("Help"));
setResizable(true);
+ setDefaultSize(500, 400, ImageRect::CENTER);
+
mBrowserBox = new BrowserBox();
mBrowserBox->setOpaque(false);
mScrollArea = new ScrollArea(mBrowserBox);
Button *okButton = new Button(_("Close"), "close", this);
- mScrollArea->setDimension(gcn::Rectangle(
- 5, 5, 445, 335 - okButton->getHeight()));
- okButton->setPosition(
- 450 - okButton->getWidth(),
- 345 - okButton->getHeight());
+ mScrollArea->setDimension(gcn::Rectangle(5, 5, 445,
+ 335 - okButton->getHeight()));
+ okButton->setPosition(450 - okButton->getWidth(),
+ 345 - okButton->getHeight());
mBrowserBox->setLinkHandler(this);
@@ -59,7 +60,7 @@ HelpWindow::HelpWindow():
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
- setLocationRelativeTo(getParent());
+ loadWindowState();
}
void HelpWindow::action(const gcn::ActionEvent &event)
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index dc232296..ca6b4010 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -38,6 +38,7 @@ extern Window *chatWindow;
extern Window *statusWindow;
extern Window *buyDialog;
extern Window *sellDialog;
+extern Window *buySellDialog;
extern Window *inventoryWindow;
extern Window *emoteWindow;
extern Window *npcTextDialog;
@@ -140,6 +141,7 @@ void Setup::action(const gcn::ActionEvent &event)
statusWindow->resetToDefaultSize();
buyDialog->resetToDefaultSize();
sellDialog->resetToDefaultSize();
+ buySellDialog->resetToDefaultSize();
inventoryWindow->resetToDefaultSize();
emoteWindow->resetToDefaultSize();
npcTextDialog->resetToDefaultSize();
diff --git a/src/gui/window.h b/src/gui/window.h
index e04fcfc3..518e1ec2 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -266,7 +266,7 @@ class Window : public gcn::Window, gcn::WidgetListener
* Reset the win pos and size to default. Don't forget to set defaults
* first.
*/
- void resetToDefaultSize();
+ virtual void resetToDefaultSize();
/**
* Gets the layout handler for this window.