summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-09 15:05:46 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-09 15:05:46 +0300
commit570c180eb44a832ff3fa2f7e262246a8ab543ff1 (patch)
tree143c0cf02d52f2e252c16681e92ac6cbe1e7710d
parentf5e41e9dc8560923b4e9b8ef89f518aaf651dfa8 (diff)
downloadmanaplus-570c180eb44a832ff3fa2f7e262246a8ab543ff1.tar.gz
manaplus-570c180eb44a832ff3fa2f7e262246a8ab543ff1.tar.bz2
manaplus-570c180eb44a832ff3fa2f7e262246a8ab543ff1.tar.xz
manaplus-570c180eb44a832ff3fa2f7e262246a8ab543ff1.zip
Add browserbox links theme options.
New theme options: highlightBackground - highlight link with background filling. highlightUnderline - highlight link with underline.
-rw-r--r--data/graphics/gui/browserbox.xml2
-rw-r--r--data/graphics/gui/onlinebrowserbox.xml2
-rw-r--r--data/graphics/gui/popupbrowserbox.xml2
-rw-r--r--data/themes/jewelry/browserbox.xml2
-rw-r--r--data/themes/jewelry/onlinebrowserbox.xml2
-rw-r--r--data/themes/jewelry/popupbrowserbox.xml2
-rw-r--r--data/themes/jewelry/popupbrowserbox_high.xml2
-rw-r--r--data/themes/jewelry/popupbrowserbox_medium.xml2
-rw-r--r--data/themes/jewelry/popupbrowserbox_xhigh.xml2
-rw-r--r--data/themes/jewelry/popupbrowserbox_xxhigh.xml2
-rw-r--r--src/gui/popups/popupmenu.cpp1
-rw-r--r--src/gui/widgets/browserbox.cpp11
-rw-r--r--src/gui/widgets/browserbox.h5
-rw-r--r--src/gui/windows/socialwindow.cpp1
-rw-r--r--src/gui/windows/whoisonline.cpp1
15 files changed, 25 insertions, 14 deletions
diff --git a/data/graphics/gui/browserbox.xml b/data/graphics/gui/browserbox.xml
index 621be46f3..63ae11a21 100644
--- a/data/graphics/gui/browserbox.xml
+++ b/data/graphics/gui/browserbox.xml
@@ -4,5 +4,7 @@
<option name="padding" value="1" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="0" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="1" />
</widget>
</skinset>
diff --git a/data/graphics/gui/onlinebrowserbox.xml b/data/graphics/gui/onlinebrowserbox.xml
index 621be46f3..b553dec54 100644
--- a/data/graphics/gui/onlinebrowserbox.xml
+++ b/data/graphics/gui/onlinebrowserbox.xml
@@ -4,5 +4,7 @@
<option name="padding" value="1" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="0" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/graphics/gui/popupbrowserbox.xml b/data/graphics/gui/popupbrowserbox.xml
index 0e61ff0e9..ebd404ff9 100644
--- a/data/graphics/gui/popupbrowserbox.xml
+++ b/data/graphics/gui/popupbrowserbox.xml
@@ -4,5 +4,7 @@
<option name="padding" value="1" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="1" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/browserbox.xml b/data/themes/jewelry/browserbox.xml
index 403dd839f..aa96242bc 100644
--- a/data/themes/jewelry/browserbox.xml
+++ b/data/themes/jewelry/browserbox.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="0" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="1" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/onlinebrowserbox.xml b/data/themes/jewelry/onlinebrowserbox.xml
index 403dd839f..bd3a86b24 100644
--- a/data/themes/jewelry/onlinebrowserbox.xml
+++ b/data/themes/jewelry/onlinebrowserbox.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="0" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/popupbrowserbox.xml b/data/themes/jewelry/popupbrowserbox.xml
index d80203ea3..a8384421c 100644
--- a/data/themes/jewelry/popupbrowserbox.xml
+++ b/data/themes/jewelry/popupbrowserbox.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="1" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/popupbrowserbox_high.xml b/data/themes/jewelry/popupbrowserbox_high.xml
index 44a2d3abf..00413591e 100644
--- a/data/themes/jewelry/popupbrowserbox_high.xml
+++ b/data/themes/jewelry/popupbrowserbox_high.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="10" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/popupbrowserbox_medium.xml b/data/themes/jewelry/popupbrowserbox_medium.xml
index 0104efde0..10443e1c0 100644
--- a/data/themes/jewelry/popupbrowserbox_medium.xml
+++ b/data/themes/jewelry/popupbrowserbox_medium.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="5" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/popupbrowserbox_xhigh.xml b/data/themes/jewelry/popupbrowserbox_xhigh.xml
index 44a2d3abf..00413591e 100644
--- a/data/themes/jewelry/popupbrowserbox_xhigh.xml
+++ b/data/themes/jewelry/popupbrowserbox_xhigh.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="10" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/data/themes/jewelry/popupbrowserbox_xxhigh.xml b/data/themes/jewelry/popupbrowserbox_xxhigh.xml
index b2da8ede2..fc8358f93 100644
--- a/data/themes/jewelry/popupbrowserbox_xxhigh.xml
+++ b/data/themes/jewelry/popupbrowserbox_xxhigh.xml
@@ -4,5 +4,7 @@
<option name="padding" value="4" />
<option name="newLinePadding" value="15" />
<option name="itemPadding" value="15" />
+ <option name="highlightBackground" value="1" />
+ <option name="highlightUnderline" value="0" />
</widget>
</skinset>
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 1674c5eeb..c048e74f1 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -111,7 +111,6 @@ PopupMenu::PopupMenu() :
mX(0),
mY(0)
{
- mBrowserBox->setHighlightMode(BrowserBox::BACKGROUND);
mBrowserBox->setOpaque(false);
mBrowserBox->setLinkHandler(this);
mRenameListener.setMapItem(nullptr);
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index a2bee9219..023c3298d 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -61,7 +61,7 @@ BrowserBox::BrowserBox(const Widget2 *const widget,
mLinkHandler(nullptr),
mSkin(nullptr),
mMode(mode),
- mHighMode(UNDERLINE | BACKGROUND),
+ mHighMode(0),
mSelectedLink(-1),
mMaxRows(0),
mHeight(0),
@@ -102,6 +102,10 @@ BrowserBox::BrowserBox(const Widget2 *const widget,
mPadding = mSkin->getPadding();
mNewLinePadding = mSkin->getOption("newLinePadding", 15);
mItemPadding = mSkin->getOption("itemPadding");
+ if (mSkin->getOption("highlightBackground"))
+ mHighMode |= BACKGROUND;
+ if (mSkin->getOption("highlightUnderline"))
+ mHighMode |= UNDERLINE;
}
mColors[0][BLACK] = getThemeColor(Theme::BLACK);
@@ -163,11 +167,6 @@ void BrowserBox::setOpaque(bool opaque)
mOpaque = opaque;
}
-void BrowserBox::setHighlightMode(const unsigned int highMode)
-{
- mHighMode = highMode;
-}
-
void BrowserBox::addRow(const std::string &row, const bool atTop)
{
std::string tmp = row;
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 7c2d3c053..3c470121a 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -133,11 +133,6 @@ class BrowserBox final : public gcn::Widget,
void setOpaque(bool opaque);
/**
- * Sets the Highlight mode for links.
- */
- void setHighlightMode(const unsigned int highMode);
-
- /**
* Sets the maximum numbers of rows in the browser box. 0 = no limit.
*/
void setMaxRow(unsigned max)
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 846a8f369..4adcc5051 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -1211,7 +1211,6 @@ public:
"popupbrowserbox.xml"))
{
mBrowserBox->setPosition(4, 4);
- mBrowserBox->setHighlightMode(BrowserBox::BACKGROUND);
mBrowserBox->setOpaque(false);
mBrowserBox->setLinkHandler(this);
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index e06788a38..e7c60bb39 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -115,7 +115,6 @@ WhoIsOnline::WhoIsOnline() :
mUpdateButton->setDimension(gcn::Rectangle(5, 5, w - 10, 20 + 5));
mBrowserBox->setOpaque(false);
- mBrowserBox->setHighlightMode(BrowserBox::BACKGROUND);
mScrollArea->setDimension(gcn::Rectangle(5, 20 + 10, w - 10, h - 10 - 30));
mScrollArea->setSize(w - 10, h - 10 - 30);
mBrowserBox->setLinkHandler(this);