summaryrefslogtreecommitdiff
path: root/src/gui/widgets/browserbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r--src/gui/widgets/browserbox.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index f6f86a42d..f87bc23e3 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -914,3 +914,31 @@ void BrowserBox::setForegroundColorAll(const Color &color1,
mForegroundColor = color1;
mForegroundColor2 = color2;
}
+
+void BrowserBox::moveSelectionUp()
+{
+ if (mSelectedLink <= 0)
+ mSelectedLink = static_cast<signed>(mLinks.size()) - 1;
+ else
+ mSelectedLink --;
+}
+
+#include "logger.h"
+
+void BrowserBox::moveSelectionDown()
+{
+ mSelectedLink ++;
+ if (mSelectedLink >= static_cast<signed int>(mLinks.size()))
+ mSelectedLink = 0;
+}
+
+void BrowserBox::selectSelection()
+{
+ if (mSelectedLink < 0 || mSelectedLink >= static_cast<signed int>(
+ mLinks.size()))
+ {
+ return;
+ }
+
+ mLinkHandler->handleLink(mLinks[mSelectedLink].link, nullptr);
+}