Merge with trunk

This commit is contained in:
andreyskv
2010-10-04 21:51:45 -07:00
20 changed files with 133 additions and 49 deletions

View File

@@ -48,6 +48,7 @@ RTWindow::RTWindow () {
mainNB = Gtk::manage (new Gtk::Notebook ());
mainNB->set_scrollable (true);
mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) );
fpanel = new FilePanel ();
fpanel->setParent (this);
@@ -127,9 +128,30 @@ void RTWindow::on_realize () {
Gtk::Window::on_realize ();
fpanel->setAspect();
cursorManager.init (get_window());
}
bool RTWindow::on_my_window_state_event(GdkEventWindowState* event) {
if (!event->new_window_state) {
// Window mode
options.windowMaximized = false;
}
else if (event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED|GDK_WINDOW_STATE_FULLSCREEN)) {
// Fullscreen mode
options.windowMaximized = true;
}
return true;
}
void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) {
if (page_num > 1) {
EditorPanel *ep = (EditorPanel *)mainNB->get_nth_page(page_num);
ep->setAspect();
}
}
void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
ep->setParent (this);
@@ -152,7 +174,9 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
hb->pack_end (*closeb);
hb->set_spacing (2);
hb->show_all ();
mainNB->append_page (*ep, *hb);
//ep->setAspect ();
mainNB->set_current_page (mainNB->page_num (*ep));
mainNB->set_tab_reorderable (*ep, true);
@@ -163,7 +187,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
void RTWindow::remEditorPanel (EditorPanel* ep) {
ep->saveOptions ();
//ep->saveOptions ();
epanels.erase (ep->getFileName());
filesEdited.erase (ep->getFileName ());
fpanel->refreshEditedState (filesEdited);
@@ -243,14 +267,10 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
options.fbArrangement = fileBrowser->getFileCatalog()->getArrangement ();
options.firstRun = false;
*/
Gdk::WindowState state = get_window()->get_state();
if (!(state & (Gdk::WINDOW_STATE_MAXIMIZED | Gdk::WINDOW_STATE_FULLSCREEN))) {
if (!options.windowMaximized) {
options.windowWidth = get_width();
options.windowHeight = get_height();
options.windowMaximized = false;
}
else
options.windowMaximized = true;
Options::save ();
hide();