aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2025-09-03 21:48:36 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2025-09-03 22:31:43 +0200
commit29a46a2da7e9350a1252e30aea3c8294097f63a4 (patch)
tree221cd82237d54183591115bc6d9bf658597a59e4 /src
parent1d55cf26a355b89a007e4a9bf7361d8a5c2c64cd (diff)
Increase horizontal margin in the location barHEADmaster
Allows users to begin selecting the text or position the cursor at the beginning of the URL without requiring a high accuracy, as now there are at least 5 pixels of leading space. Fixes: https://github.com/dillo-browser/dillo/issues/442
Diffstat (limited to 'src')
-rw-r--r--src/ui.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ui.cc b/src/ui.cc
index eb3b0b75..8230e818 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -90,13 +90,26 @@ static struct iconset *icons = &standard_icons;
//----------------------------------------------------------------------------
+#define DILLO_INPUTBOX (Fl_Boxtype) (FL_FREE_BOXTYPE + 1)
+
/**
* Used to avoid certain shortcuts in the location bar
*/
class CustInput : public TipWinInput {
public:
+ static const int margin_x = 3;
CustInput (int x, int y, int w, int h, const char* l=0) :
- TipWinInput(x,y,w,h,l) {};
+ TipWinInput(x,y,w,h,l) {
+ /* Increase the margin of the current box by making a new clone
+ * of the current box with extra margin on dx. */
+ Fl_Boxtype b = box();
+ Fl::set_boxtype(DILLO_INPUTBOX, Fl::get_boxtype(b),
+ Fl::box_dx(b) + margin_x,
+ Fl::box_dy(b),
+ Fl::box_dw(b) + margin_x,
+ Fl::box_dh(b));
+ box(DILLO_INPUTBOX);
+ }
virtual int handle(int e);
};