diff options
34 files changed, 104 insertions, 95 deletions
diff --git a/src/gui/widgets/selldialog.cpp b/src/gui/widgets/selldialog.cpp index d60e10803..c573ad392 100644 --- a/src/gui/widgets/selldialog.cpp +++ b/src/gui/widgets/selldialog.cpp @@ -87,7 +87,7 @@ void SellDialog::postInit() setStickyButtonLock(true); setMinWidth(260); setMinHeight(220); - setDefaultSize(260, 230, ImagePosition::CENTER); + setDefaultSize(260, 230, ImagePosition::CENTER, 0, 0); if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); @@ -106,7 +106,7 @@ void SellDialog::postInit() ShopListBoxType::Unknown); mShopItemList->setProtectItems(true); mScrollArea = new ScrollArea(this, mShopItemList, - fromBool(getOptionBool("showbackground"), Opaque), + fromBool(getOptionBool("showbackground", false), Opaque), "sell_background.xml"); mScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 3b34a7347..132b3f561 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -187,35 +187,35 @@ Window::Window(const std::string &caption, if (mSkin != nullptr) { setPadding(mSkin->getPadding()); - if (getOptionBool("titlebarBold")) + if (getOptionBool("titlebarBold", false)) mCaptionFont = boldFont; mTitlePadding = mSkin->getTitlePadding(); - mGripPadding = getOption("resizePadding"); - mCaptionOffsetX = getOption("captionoffsetx"); + mGripPadding = getOption("resizePadding", 0); + mCaptionOffsetX = getOption("captionoffsetx", 0); if (mCaptionOffsetX == 0) mCaptionOffsetX = 7; - mCaptionOffsetY = getOption("captionoffsety"); + mCaptionOffsetY = getOption("captionoffsety", 0); if (mCaptionOffsetY == 0) mCaptionOffsetY = 5; mCaptionAlign = static_cast<Graphics::Alignment>( - getOption("captionalign")); + getOption("captionalign", 0)); if (mCaptionAlign < Graphics::LEFT || mCaptionAlign > Graphics::RIGHT) { mCaptionAlign = Graphics::LEFT; } setTitleBarHeight(CAST_U32( - getOption("titlebarHeight"))); + getOption("titlebarHeight", 0))); if (mTitleBarHeight == 0u) mTitleBarHeight = mCaptionFont->getHeight() + mPadding; - mTitleBarHeight += getOption("titlebarHeightRelative"); - setPalette(getOption("palette")); - childPalette = getOption("childPalette"); + mTitleBarHeight += getOption("titlebarHeightRelative", 0); + setPalette(getOption("palette", 0)); + childPalette = getOption("childPalette", 0); mShowTitle = getOptionBool("showTitle", true); - mClosePadding = getOption("closePadding"); - mStickySpacing = getOption("stickySpacing"); - mStickyPadding = getOption("stickyPadding"); + mClosePadding = getOption("closePadding", 0); + mStickySpacing = getOption("stickySpacing", 0); + mStickyPadding = getOption("stickyPadding", 0); } } diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index d089680af..cffc2f17d 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -111,10 +111,10 @@ class Window notfinal : public BasicContainer2, * a window will never go below its parent window. * @param skin The location where the window's skin XML can be found. */ - explicit Window(const std::string &caption = "Window", - const Modal modal = Modal_false, - Window *const parent = nullptr, - std::string skin = ""); + Window(const std::string &caption, + const Modal modal, + Window *const parent, + std::string skin); A_DELETE_COPY(Window) @@ -155,7 +155,8 @@ class Window notfinal : public BasicContainer2, * Sets the location relative to the given enumerated position. */ void setLocationRelativeTo(const ImagePosition::Type &position, - int offsetX = 0, int offsetY = 0); + int offsetX, + int offsetY); /** * Sets whether or not the window can be resized. @@ -392,9 +393,11 @@ class Window notfinal : public BasicContainer2, * This version of setDefaultSize sets the window's position based * on a relative enumerated position, rather than a coordinate position. */ - void setDefaultSize(const int defaultWidth, const int defaultHeight, + void setDefaultSize(const int defaultWidth, + const int defaultHeight, const ImagePosition::Type &position, - const int offsetx = 0, const int offsetY = 0); + const int offsetx, + const int offsetY); /** * Reset the win pos and size to default. Don't forget to set defaults @@ -428,13 +431,17 @@ class Window notfinal : public BasicContainer2, * @param h if non-zero, force the window to this height. * @note This function is meant to be called with fixed-size windows. */ - void reflowLayout(int w = 0, int h = 0); + void reflowLayout(int w, + int h); /** * Adds a widget to the window and sets it at given cell. */ - LayoutCell &place(const int x, const int y, Widget *const wg, - const int w = 1, const int h = 1); + LayoutCell &place(const int x, + const int y, + Widget *const wg, + const int w, + const int h); /** * Returns a proxy for adding widgets in an inner table of the layout. @@ -583,10 +590,10 @@ class Window notfinal : public BasicContainer2, bool canMove() const A_WARN_UNUSED; int getOption(const std::string &name, - const int def = 0) const A_WARN_UNUSED; + const int def) const A_WARN_UNUSED; bool getOptionBool(const std::string &name, - const bool def = false) const A_WARN_UNUSED; + const bool def) const A_WARN_UNUSED; void setTitlePadding(const int p) noexcept2 { mTitlePadding = p; } diff --git a/src/gui/windows/bankwindow.cpp b/src/gui/windows/bankwindow.cpp index e02660243..0c3165f43 100644 --- a/src/gui/windows/bankwindow.cpp +++ b/src/gui/windows/bankwindow.cpp @@ -72,7 +72,7 @@ BankWindow::BankWindow() : center(); setDefaultSize(); loadWindowState(); - reflowLayout(300); + reflowLayout(300, 0); enableVisibleSound(true); } diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 901b8f199..5fec8b877 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -285,7 +285,7 @@ void BuyDialog::init() setStickyButtonLock(true); setMinWidth(260); setMinHeight(220); - setDefaultSize(260, 230, ImagePosition::CENTER); + setDefaultSize(260, 230, ImagePosition::CENTER, 0, 0); #ifdef TMWA_SUPPORT // reset advance flag for personal shops @@ -305,7 +305,7 @@ void BuyDialog::init() CREATEWIDGETV(mShopItemList, ShopListBox, this, mShopItems, mShopItems, ShopListBoxType::Unknown); mScrollArea = new ScrollArea(this, mShopItemList, - fromBool(getOptionBool("showbackground"), Opaque), + fromBool(getOptionBool("showbackground", false), Opaque), "buy_background.xml"); mScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index 06ab8a9a0..c3e09b694 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -65,7 +65,7 @@ ChangePasswordDialog::ChangePasswordDialog(LoginData &data) : place(0, 0, accountLabel, 3, 1); // TRANSLATORS: change password dialog label - place(0, 1, new Label(this, _("Password:")), 3); + place(0, 1, new Label(this, _("Password:")), 3, 1); place(0, 2, mOldPassField, 3, 1).setPadding(1); // TRANSLATORS: change password dialog label place(0, 3, new Label(this, _("Type new password twice:")), 3, 1); @@ -73,7 +73,7 @@ ChangePasswordDialog::ChangePasswordDialog(LoginData &data) : place(0, 5, mSecondPassField, 3, 1).setPadding(1); place(1, 6, mCancelButton, 1, 1); place(2, 6, mChangePassButton, 1, 1); - reflowLayout(200); + reflowLayout(200, 0); center(); mOldPassField->requestFocus(); diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index b4fa77506..524be16cc 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -141,7 +141,7 @@ CharSelectDialog::CharSelectDialog(LoginData &data) : sz = width; if (sz > mainGraphics->getWidth()) sz = mainGraphics->getWidth(); - reflowLayout(sz); + reflowLayout(sz, 0); } else { @@ -152,7 +152,7 @@ CharSelectDialog::CharSelectDialog(LoginData &data) : mCharacterView->setWidth(mainGraphics->getWidth() - 2 * getPadding()); placer(0, 1, mCharacterView, 10, 1); - reflowLayout(); + reflowLayout(0, 0); } addKeyListener(this); center(); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index b3d1679a2..8354b86bb 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -155,7 +155,7 @@ ChatWindow::ChatWindow(const std::string &name) : w = mainGraphics->getWidth() - 10; if (w < 100) w = 100; - setDefaultSize(w, 123, ImagePosition::LOWER_LEFT); + setDefaultSize(w, 123, ImagePosition::LOWER_LEFT, 0, 0); #endif // ANDROID setMinWidth(150); diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp index 8faf8b859..b9221b8db 100644 --- a/src/gui/windows/connectiondialog.cpp +++ b/src/gui/windows/connectiondialog.cpp @@ -54,7 +54,7 @@ ConnectionDialog::ConnectionDialog(const std::string &text, place(0, 0, progressIndicator, 1, 1); place(0, 1, label, 1, 1); place(0, 2, cancelButton, 1, 1).setHAlign(LayoutCell::CENTER); - reflowLayout(); + reflowLayout(0, 0); center(); if ((mSearchHash ^ 0x202020U) == 0x70E9296C) diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index e10ad1b2c..acdecf10e 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -55,7 +55,7 @@ DebugWindow::DebugWindow(const std::string &name) : setSaveVisible(true); setStickyButtonLock(true); - setDefaultSize(400, 300, ImagePosition::CENTER); + setDefaultSize(400, 300, ImagePosition::CENTER, 0, 0); mTabs->setSelectable(false); mTabs->getWidgetContainer()->setSelectable(false); diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp index 20fd26a15..ba31908dd 100644 --- a/src/gui/windows/didyouknowwindow.cpp +++ b/src/gui/windows/didyouknowwindow.cpp @@ -77,7 +77,7 @@ DidYouKnowWindow::DidYouKnowWindow() : if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); - setDefaultSize(500, 400, ImagePosition::CENTER); + setDefaultSize(500, 400, ImagePosition::CENTER, 0, 0); mBrowserBox->setOpaque(Opaque_false); // TRANSLATORS: did you know window button diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 4354a5b29..9ca3b9c4d 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -44,7 +44,7 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent, const ServerInfo &server, const int index) : // TRANSLATORS: edit server dialog name - Window(_("Edit Server"), Modal_true, parent), + Window(_("Edit Server"), Modal_true, parent, std::string()), ActionListener(), KeyListener(), mServerAddressField(new TextField(this, std::string(), @@ -138,7 +138,7 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent, setMinWidth(getWidth()); setMinHeight(getHeight()); - setDefaultSize(getWidth(), getHeight(), ImagePosition::CENTER); + setDefaultSize(getWidth(), getHeight(), ImagePosition::CENTER, 0, 0); setResizable(false); addKeyListener(this); diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index c62696704..7e7228b0a 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -84,8 +84,8 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, mLabelsColor(getThemeColor(ThemeColorId::LABEL, 255U)), mLabelsColor2(getThemeColor(ThemeColorId::LABEL_OUTLINE, 255U)), mSelected(-1), - mItemPadding(getOption("itemPadding")), - mBoxSize(getOption("boxSize")), + mItemPadding(getOption("itemPadding", 0)), + mBoxSize(getOption("boxSize", 0)), mButtonPadding(getOption("buttonPadding", 5)), mMinX(180), mMinY(345), @@ -830,7 +830,7 @@ void EquipmentWindow::recalcSize() mMaxY += mMinY; mTabs->setWidth(mMaxX); mMaxY += mUnequip->getHeight() - mYPadding; - setDefaultSize(mMaxX, mMaxY, ImagePosition::CENTER); + setDefaultSize(mMaxX, mMaxY, ImagePosition::CENTER, 0, 0); } int EquipmentWindow::addPage(const std::string &name) diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 3dde6c3df..ed30478e9 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -76,7 +76,7 @@ HelpWindow::HelpWindow() : if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); - setDefaultSize(500, 400, ImagePosition::CENTER); + setDefaultSize(500, 400, ImagePosition::CENTER, 0, 0); mBrowserBox->setOpaque(Opaque_false); diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 088f67c42..d35ba037b 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -167,9 +167,9 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : setStickyButtonLock(true); if (mainGraphics->mWidth > 600) - setDefaultSize(450, 310, ImagePosition::CENTER); + setDefaultSize(450, 310, ImagePosition::CENTER, 0, 0); else - setDefaultSize(387, 307, ImagePosition::CENTER); + setDefaultSize(387, 307, ImagePosition::CENTER, 0, 0); setMinWidth(310); setMinHeight(179); addKeyListener(this); @@ -194,7 +194,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : } ScrollArea *const invenScroll = new ScrollArea(this, mItems, - fromBool(getOptionBool("showbackground"), Opaque), + fromBool(getOptionBool("showbackground", false), Opaque), "inventory_background.xml"); invenScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); @@ -274,11 +274,11 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : // TRANSLATORS: storage button mInvCloseButton = new Button(this, _("Close"), "close", this); - mSlotsBarCell = &place(0, 0, mSlotsBar, 6); - mSortDropDownCell = &place(6, 0, mSortDropDown, 1); + mSlotsBarCell = &place(0, 0, mSlotsBar, 6, 1); + mSortDropDownCell = &place(6, 0, mSortDropDown, 1, 1); - mFilterCell = &place(0, 1, mFilter, 7).setPadding(3); - mNameFilterCell = &place(6, 1, mNameFilter, 1); + mFilterCell = &place(0, 1, mFilter, 7, 1).setPadding(3); + mNameFilterCell = &place(6, 1, mNameFilter, 1, 1); place(0, 2, invenScroll, 7, 4); place(0, 6, mStoreButton, 1, 1); @@ -303,11 +303,11 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : mWeightBar->setColor(getThemeColor(ThemeColorId::WEIGHT_BAR, 255U), getThemeColor(ThemeColorId::WEIGHT_BAR_OUTLINE, 255U)); - mSlotsBarCell = &place(3, 0, mSlotsBar, 3); - mSortDropDownCell = &place(6, 0, mSortDropDown, 1); + mSlotsBarCell = &place(3, 0, mSlotsBar, 3, 1); + mSortDropDownCell = &place(6, 0, mSortDropDown, 1, 1); - mFilterCell = &place(0, 1, mFilter, 7).setPadding(3); - mNameFilterCell = &place(6, 1, mNameFilter, 1); + mFilterCell = &place(0, 1, mFilter, 7, 1).setPadding(3); + mNameFilterCell = &place(6, 1, mNameFilter, 1, 1); place(0, 0, mWeightBar, 3, 1); place(0, 2, invenScroll, 7, 4); diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 0f9829ae5..9799fc87d 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -193,7 +193,7 @@ void LoginDialog::postInit() center(); loadWindowState(); - reflowLayout(); + reflowLayout(0, 0); if (mUserField->getText().empty()) mUserField->requestFocus(); diff --git a/src/gui/windows/maileditwindow.cpp b/src/gui/windows/maileditwindow.cpp index b70188786..017113f0e 100644 --- a/src/gui/windows/maileditwindow.cpp +++ b/src/gui/windows/maileditwindow.cpp @@ -82,7 +82,7 @@ MailEditWindow::MailEditWindow() : mItemContainer(new ItemContainer(this, mInventory, 100000, ShowEmptyRows_false, ForceQuantity_false)), mItemScrollArea(new ScrollArea(this, mItemContainer, - fromBool(getOptionBool("showitemsbackground"), Opaque), + fromBool(getOptionBool("showitemsbackground", false), Opaque), "mailedit_listbackground.xml")), mUseMail2(settings.enableNewMailSystem) { @@ -94,7 +94,7 @@ MailEditWindow::MailEditWindow() : setStickyButtonLock(true); setVisible(Visible_true); - setDefaultSize(380, 200, ImagePosition::CENTER); + setDefaultSize(380, 200, ImagePosition::CENTER, 0, 0); setMinWidth(200); setMinHeight(200); center(); diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp index add46a7f2..cd924445f 100644 --- a/src/gui/windows/mailviewwindow.cpp +++ b/src/gui/windows/mailviewwindow.cpp @@ -80,7 +80,7 @@ MailViewWindow::MailViewWindow(MailMessage *const message, mItemContainer(new ItemContainer(this, mInventory, 100000, ShowEmptyRows_false, ForceQuantity_false)), mItemScrollArea(new ScrollArea(this, mItemContainer, - fromBool(getOptionBool("showitemsbackground"), Opaque), + fromBool(getOptionBool("showitemsbackground", false), Opaque), "mailview_listbackground.xml")), mUseMail2(settings.enableNewMailSystem) { @@ -91,7 +91,7 @@ MailViewWindow::MailViewWindow(MailMessage *const message, setStickyButtonLock(true); setVisible(Visible_true); - setDefaultSize(380, 370, ImagePosition::CENTER); + setDefaultSize(380, 370, ImagePosition::CENTER, 0, 0); setMinWidth(200); setMinHeight(100); center(); diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 963b981be..1b3b35cd6 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -63,7 +63,7 @@ MailWindow::MailWindow() : mListBox(CREATEWIDGETR(ExtendedListBox, this, mMailModel, "extendedlistbox.xml", 0)), mListScrollArea(new ScrollArea(this, mListBox, - fromBool(getOptionBool("showlistbackground"), Opaque), + fromBool(getOptionBool("showlistbackground", false), Opaque), "mail_listbackground.xml")), // TRANSLATORS: mail window button mRefreshButton(new Button(this, _("Refresh"), "refresh", this)), @@ -91,7 +91,7 @@ MailWindow::MailWindow() : if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); - setDefaultSize(310, 180, ImagePosition::CENTER); + setDefaultSize(310, 180, ImagePosition::CENTER, 0, 0); setMinWidth(310); setMinHeight(250); center(); diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 4279c57eb..b93e843b7 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -104,7 +104,7 @@ NpcDialog::NpcDialog(const BeingId npcId) : mTextBox(new BrowserBox(this, Opaque_true, "browserbox.xml")), mScrollArea(new ScrollArea(this, mTextBox, - fromBool(getOptionBool("showtextbackground"), Opaque), + fromBool(getOptionBool("showtextbackground", false), Opaque), "npc_textbackground.xml")), mText(), mNewText(), @@ -113,11 +113,11 @@ NpcDialog::NpcDialog(const BeingId npcId) : mItemList(CREATEWIDGETR(ExtendedListBox, this, this, "extendedlistbox.xml", 13)), mListScrollArea(new ScrollArea(this, mItemList, - fromBool(getOptionBool("showlistbackground"), Opaque), + fromBool(getOptionBool("showlistbackground", false), Opaque), "npc_listbackground.xml")), mSkinContainer(new Container(this)), mSkinScrollArea(new ScrollArea(this, mSkinContainer, - fromBool(getOptionBool("showlistbackground"), Opaque), + fromBool(getOptionBool("showlistbackground", false), Opaque), "npc_listbackground.xml")), mItemLinkHandler(new ItemLinkHandler), mTextField(new TextField(this, std::string(), LoseFocusOnTab_true, @@ -141,7 +141,7 @@ NpcDialog::NpcDialog(const BeingId npcId) : mItemContainer(new ItemContainer(this, mInventory, 10000, ShowEmptyRows_true, ForceQuantity_false)), mItemScrollArea(new ScrollArea(this, mItemContainer, - fromBool(getOptionBool("showitemsbackground"), Opaque), + fromBool(getOptionBool("showitemsbackground", false), Opaque), "npc_listbackground.xml")), mInputState(NpcInputState::NONE), mActionState(NpcActionState::WAIT), @@ -166,7 +166,7 @@ NpcDialog::NpcDialog(const BeingId npcId) : setMinWidth(200); setMinHeight(150); - setDefaultSize(300, 578, ImagePosition::LOWER_LEFT); + setDefaultSize(300, 578, ImagePosition::LOWER_LEFT, 0, 0); mPlayerBox->setWidth(70); mPlayerBox->setHeight(100); diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 08863d86a..af867754a 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -68,13 +68,13 @@ QuestsWindow::QuestsWindow() : mQuestsListBox(CREATEWIDGETR(ExtendedListBox, this, mQuestsModel, "extendedlistbox.xml", 13)), mQuestScrollArea(new ScrollArea(this, mQuestsListBox, - fromBool(getOptionBool("showlistbackground"), Opaque), + fromBool(getOptionBool("showlistbackground", false), Opaque), "quests_list_background.xml")), mItemLinkHandler(new ItemLinkHandler), mText(new BrowserBox(this, Opaque_true, "browserbox.xml")), mTextScrollArea(new ScrollArea(this, mText, - fromBool(getOptionBool("showtextbackground"), Opaque), + fromBool(getOptionBool("showtextbackground", false), Opaque), "quests_text_background.xml")), // TRANSLATORS: quests window button mCloseButton(new Button(this, _("Close"), "close", this)), @@ -97,7 +97,7 @@ QuestsWindow::QuestsWindow() : setStickyButtonLock(true); setSaveVisible(true); - setDefaultSize(400, 350, ImagePosition::RIGHT); + setDefaultSize(400, 350, ImagePosition::RIGHT, 0, 0); setMinWidth(310); setMinHeight(220); diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 72b8fdf1f..a5a6885ad 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -147,7 +147,7 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mServersList->addMouseListener(this); ScrollArea *const usedScroll = new ScrollArea(this, mServersList, - fromBool(getOptionBool("showbackground"), Opaque), + fromBool(getOptionBool("showbackground", false), Opaque), "server_background.xml"); usedScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); @@ -178,7 +178,7 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, setMinWidth(310); setMinHeight(220); - setDefaultSize(getWidth(), getHeight(), ImagePosition::CENTER); + setDefaultSize(getWidth(), getHeight(), ImagePosition::CENTER, 0, 0); setResizable(true); addKeyListener(this); diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp index d3c851835..7b1cff745 100644 --- a/src/gui/windows/serverinfowindow.cpp +++ b/src/gui/windows/serverinfowindow.cpp @@ -54,7 +54,7 @@ ServerInfoWindow::ServerInfoWindow(ServerInfo &serverInfo) : setResizable(true); setStickyButtonLock(true); - setDefaultSize(500, 400, ImagePosition::CENTER); + setDefaultSize(500, 400, ImagePosition::CENTER, 0, 0); mBrowserBox->setOpaque(Opaque_false); mBrowserBox->setLinkHandler(this); diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 57406fb4b..270727f4b 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -118,7 +118,7 @@ ShopWindow::ShopWindow() : this, mSellShopItems, mSellShopItems, ShopListBoxType::SellShop)), mCurrentShopItemList(nullptr), mScrollArea(new ScrollArea(this, mBuyShopItemList, - fromBool(getOptionBool("showbuybackground"), Opaque), + fromBool(getOptionBool("showbuybackground", false), Opaque), "shop_buy_background.xml")), // TRANSLATORS: shop window label mAddButton(new Button(this, _("Add"), "add", this)), @@ -152,9 +152,9 @@ ShopWindow::ShopWindow() : setMinWidth(300); setMinHeight(220); if (mainGraphics->mWidth > 600) - setDefaultSize(500, 300, ImagePosition::CENTER); + setDefaultSize(500, 300, ImagePosition::CENTER, 0, 0); else - setDefaultSize(380, 300, ImagePosition::CENTER); + setDefaultSize(380, 300, ImagePosition::CENTER, 0, 0); if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index efc66872f..ae07f449c 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -92,7 +92,7 @@ ShortcutWindow::ShortcutWindow(const std::string &restrict title, if (height == 0) height = bh * maxItems + border; - setDefaultSize(width, height, ImagePosition::LOWER_RIGHT); + setDefaultSize(width, height, ImagePosition::LOWER_RIGHT, 0, 0); mBoxesWidth += bw + border; } @@ -135,7 +135,7 @@ ShortcutWindow::ShortcutWindow(const std::string &restrict title, setupWindow->registerWindowForReset(this); if ((width != 0) && (height != 0)) - setDefaultSize(width, height, ImagePosition::LOWER_RIGHT); + setDefaultSize(width, height, ImagePosition::LOWER_RIGHT, 0, 0); setMinWidth(32); setMinHeight(32); diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 062041b32..357564ae3 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -63,12 +63,12 @@ SocialWindow::SocialWindow() : mPickupFilter(nullptr), // TRANSLATORS: here P is title for visible players tab in social window mPlayers(new SocialPlayersTab(this, _("P"), - fromBool(getOptionBool("showtabbackground"), Opaque))), + fromBool(getOptionBool("showtabbackground", false), Opaque))), mNavigation(new SocialNavigationTab(this, - fromBool(getOptionBool("showtabbackground"), Opaque))), + fromBool(getOptionBool("showtabbackground", false), Opaque))), // TRANSLATORS: here F is title for friends tab in social window mFriends(new SocialFriendsTab(this, _("F"), - fromBool(getOptionBool("showtabbackground"), Opaque))), + fromBool(getOptionBool("showtabbackground", false), Opaque))), // TRANSLATORS: social window button mMenuButton(new Button(this, _("Menu"), "menu", this)), mCountLabel(new Label(this, "1000 / 1000")), @@ -116,7 +116,7 @@ void SocialWindow::postInit() if (config.getBoolValue("enableAttackFilter")) { mAttackFilter = new SocialAttackTab(this, - fromBool(getOptionBool("showtabbackground"), Opaque)); + fromBool(getOptionBool("showtabbackground", false), Opaque)); mTabs->addTab(mAttackFilter, mAttackFilter->mScroll); } else @@ -127,7 +127,7 @@ void SocialWindow::postInit() if (config.getBoolValue("enablePickupFilter")) { mPickupFilter = new SocialPickupTab(this, - fromBool(getOptionBool("showtabbackground"), Opaque)); + fromBool(getOptionBool("showtabbackground", false), Opaque)); mTabs->addTab(mPickupFilter, mPickupFilter->mScroll); } else @@ -195,13 +195,13 @@ bool SocialWindow::addTab(Guild *const guild) if (guild->getServerGuild()) { tab = new SocialGuildTab(this, guild, - fromBool(getOptionBool("showtabbackground"), Opaque)); + fromBool(getOptionBool("showtabbackground", false), Opaque)); } #ifdef TMWA_SUPPORT else { tab = new SocialGuildTab2(this, guild, - fromBool(getOptionBool("showtabbackground"), Opaque)); + fromBool(getOptionBool("showtabbackground", false), Opaque)); } #endif // TMWA_SUPPORT @@ -237,7 +237,7 @@ bool SocialWindow::addTab(Party *const party) return false; SocialPartyTab *const tab = new SocialPartyTab(this, party, - fromBool(getOptionBool("showtabbackground"), Opaque)); + fromBool(getOptionBool("showtabbackground", false), Opaque)); mParties[party] = tab; mTabs->addTab(tab, tab->mScroll); diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 43a4b05e4..f7360ff36 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -97,7 +97,9 @@ StatusWindow::StatusWindow() : setSaveVisible(true); setStickyButtonLock(true); setDefaultSize((windowContainer->getWidth() - 480) / 2, - (windowContainer->getHeight() - 500) / 2, 480, 500); + (windowContainer->getHeight() - 500) / 2, + 480, + 500); mTabs->setSelectable(false); mTabs->getWidgetContainer()->setSelectable(false); diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp index d59868131..8f9fedc51 100644 --- a/src/gui/windows/textcommandeditor.cpp +++ b/src/gui/windows/textcommandeditor.cpp @@ -118,7 +118,7 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : keyboard.setEnabled(false); setWindowName("TextCommandEditor"); - setDefaultSize(w, h, ImagePosition::CENTER); + setDefaultSize(w, h, ImagePosition::CENTER, 0, 0); #ifdef TMWA_SUPPORT mIsMagic->setActionEventId("magic"); @@ -226,7 +226,7 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : setWidth(w); setHeight(h); - reflowLayout(w); + reflowLayout(w, 0); center(); } diff --git a/src/gui/windows/textdialog.cpp b/src/gui/windows/textdialog.cpp index 405e4667c..b37a43568 100644 --- a/src/gui/windows/textdialog.cpp +++ b/src/gui/windows/textdialog.cpp @@ -81,7 +81,7 @@ TextDialog::TextDialog(const std::string &restrict title, int width = getFont()->getWidth(title); if (width < textLabel->getWidth()) width = textLabel->getWidth(); - reflowLayout(CAST_S32(width + 20)); + reflowLayout(CAST_S32(width + 20), 0); } void TextDialog::postInit() diff --git a/src/gui/windows/textselectdialog.cpp b/src/gui/windows/textselectdialog.cpp index ce4b7e73d..8f47270d4 100644 --- a/src/gui/windows/textselectdialog.cpp +++ b/src/gui/windows/textselectdialog.cpp @@ -68,7 +68,7 @@ void TextSelectDialog::postInit() setStickyButtonLock(true); setMinWidth(260); setMinHeight(220); - setDefaultSize(260, 230, ImagePosition::CENTER); + setDefaultSize(260, 230, ImagePosition::CENTER, 0, 0); if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); @@ -80,7 +80,7 @@ void TextSelectDialog::postInit() mModel, "listbox.xml"); mScrollArea = new ScrollArea(this, mItemList, - fromBool(getOptionBool("showbackground"), Opaque), + fromBool(getOptionBool("showbackground", false), Opaque), "sell_background.xml"); mScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index b264fc7fc..cda00fe56 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -106,7 +106,7 @@ TradeWindow::TradeWindow() : setResizable(true); setCloseButton(true); setStickyButtonLock(true); - setDefaultSize(386, 180, ImagePosition::CENTER); + setDefaultSize(386, 180, ImagePosition::CENTER, 0, 0); setMinWidth(310); setMinHeight(180); diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index c8eefbac6..3acc930dc 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -214,7 +214,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, { setWindowName("UpdaterWindow"); setResizable(true); - setDefaultSize(450, 400, ImagePosition::CENTER); + setDefaultSize(450, 400, ImagePosition::CENTER, 0, 0); setMinWidth(310); setMinHeight(220); diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 0e506602f..6b140aa30 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -135,7 +135,7 @@ void WhoIsOnline::postInit() Window::postInit(); const int h = 350; const int w = 200; - setDefaultSize(w, h, ImagePosition::CENTER); + setDefaultSize(w, h, ImagePosition::CENTER, 0, 0); setVisible(Visible_false); setCloseButton(true); diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index 87907845e..e44fea8dd 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -55,7 +55,7 @@ WorldSelectDialog::WorldSelectDialog(const Worlds &worlds) : mChooseWorld(new Button(this, _("Choose World"), "world", this)) { ScrollArea *const worldsScroll = new ScrollArea(this, mWorldList, - fromBool(getOptionBool("showbackground"), Opaque), + fromBool(getOptionBool("showbackground", false), Opaque), "world_background.xml"); worldsScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); |