]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui.C
Fix small bug in reading \set_color in lyxrc
[lyx.git] / src / lyx_gui.C
index a77e816d8174f04393630e73d90477d1fb4f8867..e33d6a5f37b855912ea314e5164f5287a5a4c757 100644 (file)
 #    include <kapp.h>
 #endif
 
+#ifdef GTKGUI
+#    include <gnome--/main.h>
+#endif
+
 #include <fcntl.h>
 #include "lyx_gui.h"
 #include FORMS_H_LOCATION
+#include "support/filetools.h"
 #include "combox.h"
 #include "lyx.h"
 #include "form1.h"
@@ -29,7 +34,7 @@
 #include "print_form.h"
 #include "tex-strings.h"
 #include "lyx_main.h"
-#include "latexoptions.h"
+#include "log_form.h"
 #include "debug.h"
 #include "version.h"
 #include "LyXView.h"
 #include "language.h"
 #include "ColorHandler.h"
 
-#ifdef TWO_COLOR_ICONS
-#include "banner_bw.xbm"
-#else
-#include "banner.xpm"
-#endif
-
 using std::endl;
 
 FD_form_title * fd_form_title;
@@ -67,8 +66,7 @@ FD_form_figure * fd_form_figure;
 FD_form_screen * fd_form_screen;
 FD_form_toc * fd_form_toc;
 FD_form_ref * fd_form_ref;
-FD_LaTeXOptions * fd_latex_options; // from latexoptions.h
-FD_LaTeXLog * fd_latex_log; // from latexoptions.h
+FD_LaTeXLog * fd_latex_log; // from log_form.h
 Combox * combo_language;
 Combox * combo_language2;
 
@@ -142,8 +140,11 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
        XSetErrorHandler(LyX_XErrHandler);
 
        // A width less than 590 pops up an awkward main window
-       if (width < 590) width = 590;
-
+       // The minimal values of width/height (590/400) are defined in
+       // src/lyx.C  
+        if (width < 590) width = 590;
+       if (height < 400) height = 400;
+       
        // If width is not set by geometry, check it against monitor width
        if ( !(geometryBitmask & 4) ) {
                Screen * scr = DefaultScreenOfDisplay(fl_get_display());
@@ -300,39 +301,26 @@ void LyXGUI::create_forms()
        //
 
        // the title form
-       if (lyxrc.show_banner) {
+       string banner_file = LibFileSearch("images", "banner", "xpm");
+       if (lyxrc.show_banner && !banner_file.empty()) {
                fd_form_title = create_form_form_title();
                fl_set_form_dblbuffer(fd_form_title->form_title, 1); // use dbl buffer
                fl_set_form_atclose(fd_form_title->form_title, CancelCloseBoxCB, 0);
                fl_addto_form(fd_form_title->form_title);
-#ifdef TWO_COLOR_ICONS
-               FL_OBJECT *obj = fl_add_bitmapbutton(FL_NORMAL_BUTTON, 0, 0, 425, 290, "");
-               fl_set_bitmapbutton_data(obj, banner_bw_width,
-                                        banner_bw_height, banner_bw_bits);
-               fl_set_object_color(obj, FL_WHITE, FL_BLACK);
-#else
                FL_OBJECT *obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 0, 0, 425, 290, "");
-               fl_set_pixmapbutton_data(obj, const_cast<char **>(banner));
+               fl_set_pixmapbutton_file(obj, banner_file.c_str());
                
                fl_set_pixmapbutton_focus_outline(obj, 3);
-#endif
                fl_set_button_shortcut(obj, "^M ^[", 1);
                fl_set_object_boxtype(obj, FL_NO_BOX);
                fl_set_object_callback(obj, TimerCB, 0);
                
                obj = fl_add_text(FL_NORMAL_TEXT, 248, 265, 170, 16, LYX_VERSION);
                fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-#ifdef TWO_COLOR_ICONS
-               fl_set_object_color(obj, FL_WHITE, FL_WHITE);
-               fl_set_object_lcol(obj, FL_BLACK);
-#else
-//       fl_set_object_color(obj, FL_WHITE, FL_WHITE);
-//       fl_set_object_lcol(obj, FL_BLACK);
                fl_mapcolor(FL_FREE_COL2, 0x05, 0x2e, 0x4c);
                fl_mapcolor(FL_FREE_COL3, 0xe1, 0xd2, 0x9b);
                fl_set_object_color(obj, FL_FREE_COL2, FL_FREE_COL2);
                fl_set_object_lcol(obj, FL_FREE_COL3);
-#endif
                fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
                fl_set_object_lstyle(obj, FL_BOLD_STYLE);
                fl_end_form();
@@ -556,11 +544,6 @@ void LyXGUI::create_forms()
        fl_set_form_minsize(fd_form_ref->form_ref, fd_form_ref->form_ref->w,
                            fd_form_ref->form_ref->h);
 
-       // the latex options form
-       fd_latex_options = create_form_LaTeXOptions();
-       fl_set_form_atclose(fd_latex_options->LaTeXOptions,
-                           CancelCloseBoxCB, 0);
-
        // the latex log form
        fd_latex_log = create_form_LaTeXLog();
        fl_set_form_atclose(fd_latex_log->LaTeXLog,
@@ -611,6 +594,10 @@ void LyXGUI::runTime()
 #ifdef KDEGUI
                kapp->processEvents();
 #endif
+#ifdef GTKGUI
+               Gnome::Main::instance()->iteration(FALSE);
+#endif
+               
                if (fl_check_forms() == FL_EVENT) {
                        lyxerr << "LyX: This shouldn't happen..." << endl;
                        fl_XNextEvent(&ev);