summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-07 12:26:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-07 12:26:04 +0300
commita00dea8005b6d939e846a5a50fdbc2adf001cd78 (patch)
tree9fb03f95b5ef78dcdaf0b70283c9847392edf782
parent8ccb8f9c7c82593ac2e92741914e5df9e30d8b93 (diff)
downloadmv-a00dea8005b6d939e846a5a50fdbc2adf001cd78.tar.gz
mv-a00dea8005b6d939e846a5a50fdbc2adf001cd78.tar.bz2
mv-a00dea8005b6d939e846a5a50fdbc2adf001cd78.tar.xz
mv-a00dea8005b6d939e846a5a50fdbc2adf001cd78.zip
improve confirm dialog.
-rw-r--r--src/gui/confirmdialog.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/confirmdialog.cpp b/src/gui/confirmdialog.cpp
index 1351cd89c..cef2237d7 100644
--- a/src/gui/confirmdialog.cpp
+++ b/src/gui/confirmdialog.cpp
@@ -50,17 +50,13 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
Button *const yesButton = new Button(this, _("Yes"), "yes", this);
// TRANSLATORS: confirm dialog button
Button *const noButton = new Button(this, _("No"), "no", this);
- Button *ignoreButton = nullptr;
-
- if (ignore)
- {
+ Button *const ignoreButton = ignore ? new Button(
// TRANSLATORS: confirm dialog button
- ignoreButton = new Button(this, _("Ignore"), "ignore", this);
- }
+ this, _("Ignore"), "ignore", this) : nullptr;
const int numRows = mTextBox->getNumberOfRows();
int inWidth = yesButton->getWidth() + noButton->getWidth() +
- (2 * getPadding());
+ (2 * mPadding);
if (ignoreButton)
inWidth += ignoreButton->getWidth();
@@ -76,18 +72,18 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
setContentSize(mTextBox->getMinWidth() + fontHeight, height + fontHeight +
noButton->getHeight());
- mTextBox->setPosition(getPadding(), getPadding());
+ mTextBox->setPosition(mPadding, mPadding);
// 8 is the padding that GUIChan adds to button widgets
// (top and bottom combined)
const int buttonPadding = getOption("buttonPadding", 8);
yesButton->setPosition((width - inWidth) / 2, height + buttonPadding);
noButton->setPosition(yesButton->getX() + yesButton->getWidth()
- + (2 * getPadding()), height + buttonPadding);
+ + (2 * mPadding), height + buttonPadding);
if (ignoreButton)
{
ignoreButton->setPosition(noButton->getX() + noButton->getWidth()
- + (2 * getPadding()), height + buttonPadding);
+ + (2 * mPadding), height + buttonPadding);
}
add(mTextBox);