aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/dialog.cc10
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c637d15..9c81d269 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,6 +59,7 @@ dillo-fltk2
- Added the "static" qualifier where missing.
- Bound "Copy link location".
- Bound preliminar find text support.
+ - Added line numbers and enabled wrapping in the "View Source" window.
Patches: place
+- Fixed a problem with locally-installed dpis.
- Added code for optional image loading (nice interface) very advanced!
diff --git a/src/dialog.cc b/src/dialog.cc
index 934af086..5b8d3a13 100644
--- a/src/dialog.cc
+++ b/src/dialog.cc
@@ -101,6 +101,7 @@ char *a_Dialog_open_file(const char *msg,
void a_Dialog_text_window(const char *txt, const char *title)
{
int wh = 500, ww = 480, bh = 30;
+ int lines, line_num_width;
TextBuffer *text_buf = new TextBuffer();
text_buf->text(txt);
@@ -109,6 +110,15 @@ void a_Dialog_text_window(const char *txt, const char *title)
TextDisplay *td = new TextDisplay(0,0,ww, wh-bh);
td->buffer(text_buf);
+ /* enable wrapping lines; text uses entire width of window */
+ td->wrap_mode(true, 0);
+
+ lines = td->total_lines();
+ line_num_width = 2;
+ while (lines /= 10)
+ ++line_num_width;
+ line_num_width = (int)(line_num_width * fltk::getwidth("0"));
+ td->linenumber_width(line_num_width);
ReturnButton *b = new ReturnButton (0, wh-bh, ww, bh, "Close");
b->callback(window_close_cb, window);