summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui.cc16
-rw-r--r--src/uicmd.cc25
2 files changed, 28 insertions, 13 deletions
diff --git a/src/ui.cc b/src/ui.cc
index 72b9b42e..2de27fc9 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -644,8 +644,8 @@ void UI::make_status_panel(int ww)
/*
* User Interface constructor
*/
-UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) :
- Fl_Pack(x, y, ww, wh, label)
+UI::UI(int x, int y, int ui_w, int ui_h, const char* label, const UI *cur_ui) :
+ Fl_Pack(x, y, ui_w, ui_h, label)
{
PointerOnLink = FALSE;
@@ -676,11 +676,12 @@ UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) :
// Control panel
TopGroup->begin();
- make_panel(ww);
+ make_panel(ui_w);
// Render area
- int mh = wh - (lh+bh+sh);
+ int mh = ui_h - (lh+bh+sh);
Main = new Fl_Group(0,0,0,mh,"Welcome...");
+ Main->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
Main->box(FL_FLAT_BOX);
Main->color(FL_GRAY_RAMP + 3);
Main->labelfont(FL_HELVETICA_BOLD_ITALIC);
@@ -691,11 +692,11 @@ UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) :
MainIdx = TopGroup->find(Main);
// Find text bar
- findbar = new Findbar(ww, 28);
+ findbar = new Findbar(ui_w, 28);
//TopGroup->add(findbar);
// Status Panel
- make_status_panel(ww);
+ make_status_panel(ui_w);
//TopGroup->add(StatusPanel);
TopGroup->end();
@@ -1058,14 +1059,13 @@ void UI::panelmode_cb_i()
*/
void UI::set_render_layout(Fl_Group &nw)
{
- // We'll use a workaround in a_UIcmd_browser_window_new() instead.
TopGroup->remove(MainIdx);
delete(Main);
TopGroup->insert(nw, MainIdx);
Main = &nw;
+ TopGroup->resizable(Main);
//TopGroup->box(FL_DOWN_BOX);
//TopGroup->box(FL_BORDER_FRAME);
- TopGroup->resizable(TopGroup->child(MainIdx));
}
/*
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 74cfbb7b..7635e306 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -21,6 +21,7 @@
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Wizard.H>
#include <FL/Fl_Box.H>
+#include <FL/names.h>
#include "paths.hh"
#include "keys.hh"
@@ -55,6 +56,7 @@ using namespace dw::fltk;
* Local data
*/
static char *save_dir = NULL;
+static UI *Gui;
//----------------------------------------------------------------------------
@@ -95,7 +97,10 @@ public:
Wizard = new Fl_Wizard(0,tab_h,ww,wh-tab_h);
Wizard->end();
- add_new_tab(1);
+ Gui = add_new_tab(1);
+ printf("Wizard window: %p\n", Wizard->window());
+ //printf("Gui visible: %d\n", Gui->visible());
+ //printf("Gui visible_r: %d\n", Gui->visible_r());
};
int handle(int e);
UI *add_new_tab(int focus);
@@ -150,6 +155,7 @@ UI *CustTabs::add_new_tab(int focus)
UI *new_ui = new UI(0,tab_h,Wizard->w(),Wizard->h());
new_ui->tabs(this);
Wizard->add(new_ui);
+ new_ui->show();
int ntabs = children();
snprintf(tab_label, 64,"ctab%d", ++tab_n);
@@ -306,16 +312,21 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh,
else
win = new Fl_Double_Window(ww, wh);
- Fl_Group::current(0);
+ //Fl_Group::current(0);
CustTabs *DilloTabs = new CustTabs(ww, wh, 16);
DilloTabs->selection_color(156);
- win->add(DilloTabs);
+ //win->add(DilloTabs);
+#if 0
// Create and set the UI
UI *new_ui = DilloTabs->add_new_tab(1);
+ //DilloTabs->window()->show();
+#else
+ UI *new_ui = Gui;
+ //win->resizable(new_ui);
win->resizable(new_ui);
win->show();
- //DilloTabs->window()->show();
+#endif
if (old_bw == NULL && prefs.xpos >= 0 && prefs.ypos >= 0) {
// position the first window according to preferences
@@ -349,7 +360,7 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh,
win->callback(win_cb, DilloTabs);
- new_ui->focus_location();
+ //new_ui->focus_location();
return new_bw;
}
@@ -479,10 +490,12 @@ void a_UIcmd_open_urlstr(void *vbw, const char *urlstr)
*/
void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
{
+#if 0
a_Nav_push(bw, url, NULL);
if (BW2UI(bw)->get_panelmode() == UI_TEMPORARILY_SHOW_PANELS)
BW2UI(bw)->set_panelmode(UI_HIDDEN);
a_UIcmd_focus_main_area(bw);
+#endif
}
static void UIcmd_open_url_nbw(BrowserWindow *new_bw, const DilloUrl *url)
@@ -1117,6 +1130,7 @@ void a_UIcmd_set_msg(BrowserWindow *bw, const char *format, ...)
*/
void a_UIcmd_set_buttons_sens(BrowserWindow *bw)
{
+#if 0
int sens;
// Stop
@@ -1129,6 +1143,7 @@ void a_UIcmd_set_buttons_sens(BrowserWindow *bw)
sens = (a_Nav_stack_ptr(bw) < a_Nav_stack_size(bw) - 1 &&
!bw->nav_expecting);
BW2UI(bw)->button_set_sens(UI_FORW, sens);
+#endif
}
/*