aboutsummaryrefslogtreecommitdiff
path: root/src/ui.cc
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-05-22 18:31:16 +0200
committerjcid <devnull@localhost>2008-05-22 18:31:16 +0200
commit5bebce82075f689f7cf0d749ecd2498bd4c52ff7 (patch)
tree13ccae2711aa8dbd7d8bc97eb4d51290575e23fb /src/ui.cc
parent9d97108cd3fe3a35bfcfabdf0839ab8d089dc483 (diff)
- Replaced the findtext dialog with an in-window widget!
Diffstat (limited to 'src/ui.cc')
-rw-r--r--src/ui.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/ui.cc b/src/ui.cc
index ce1f1cfa..8a4db372 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -19,7 +19,7 @@
#include <fltk/damage.h>
#include <fltk/xpmImage.h>
#include <fltk/MultiImage.h>
-#include <fltk/events.h> // for mouse buttons
+#include <fltk/events.h> // for mouse buttons and keys
#include <fltk/InvisibleBox.h>
#include <fltk/PopupMenu.h>
#include <fltk/Item.h>
@@ -33,7 +33,6 @@ using namespace fltk;
// Include image data
#include "pixmaps.h"
-
#include "uicmd.hh"
/*
@@ -631,6 +630,10 @@ UI::UI(int win_w, int win_h, const char* label, const UI *cur_ui) :
TopGroup->resizable(Main);
MainIdx = TopGroup->find(Main);
+ // Find text bar
+ findbar = new Findbar(win_w, 30, this);
+ TopGroup->add(findbar);
+
// Status Panel
StatusPanel = new Group(0, 0, win_w, s_h, 0);
// Status box
@@ -642,6 +645,7 @@ UI::UI(int win_w, int win_h, const char* label, const UI *cur_ui) :
Status->box(THIN_DOWN_BOX);
Status->clear_click_to_focus();
Status->clear_tab_to_focus();
+ Status->color(GRAY80);
StatusPanel->add(Status);
//Status->throw_focus();
@@ -723,7 +727,7 @@ int UI::handle(int event)
a_UIcmd_book(user_data());
ret = 1;
} else if (k == 'f') {
- a_UIcmd_findtext_dialog((BrowserWindow*) user_data());
+ set_findbar_visibility(1);
ret = 1;
} else if (k == 'l') {
if (Panelmode == UI_HIDDEN) {
@@ -1055,3 +1059,14 @@ void UI::paste_url()
paste(*Clear, false);
}
+/*
+ * Shows or hides the findbar of this window
+ */
+void UI::set_findbar_visibility(bool visible)
+{
+ if (visible) {
+ findbar->show();
+ } else {
+ findbar->hide();
+ }
+}