summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/browserbox.cpp8
-rw-r--r--src/gui/widgets/browserbox.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 014e4cf58..d3e2efc67 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -72,6 +72,7 @@ BrowserBox::BrowserBox(const Widget2 *const widget,
mPadding(0),
mNewLinePadding(15),
mItemPadding(0),
+ mDataWidth(0),
mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
mHyperLinkColor(getThemeColor(Theme::HYPERLINK)),
mOpaque(opaque),
@@ -403,6 +404,7 @@ void BrowserBox::clearRows()
setHeight(0);
mSelectedLink = -1;
mUpdateTime = 0;
+ mDataWidth = 0;
updateHeight();
}
@@ -751,7 +753,11 @@ int BrowserBox::calcHeight()
start += 3;
if (start == row.size())
+ {
+ if (x > mDataWidth)
+ mDataWidth = x;
break;
+ }
}
}
const size_t len = (end == std::string::npos) ? end : end - start;
@@ -832,6 +838,8 @@ int BrowserBox::calcHeight()
break;
x += width;
+ if (x > mDataWidth)
+ mDataWidth = x;
}
y += fontHeight;
}
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index fd037506b..5a09f60d6 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -234,6 +234,9 @@ class BrowserBox final : public gcn::Widget,
void setForegroundColorAll(const gcn::Color &color1,
const gcn::Color &color2);
+ int getDataWidth() const
+ { return mDataWidth; }
+
private:
int calcHeight() A_WARN_UNUSED;
@@ -264,6 +267,7 @@ class BrowserBox final : public gcn::Widget,
int mPadding;
int mNewLinePadding;
int mItemPadding;
+ unsigned int mDataWidth;
gcn::Color mHighlightColor;
gcn::Color mHyperLinkColor;