Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_desktop_widget_layout ( SPDesktopWidget dtw  ) 

Hide whatever the user does not want to see in the window

Definition at line 1195 of file desktop-widget.cpp.

References SPDesktopWidget::aux_toolbox, SPDesktopWidget::cms_adjust, SPDesktopWidget::commands_toolbox, SPDesktopWidget::desktop, Inkscape::Preferences::get(), Inkscape::Preferences::getBool(), SPDesktopWidget::hruler, SPDesktopWidget::hscrollbar, SPDesktop::is_focusMode(), SPDesktop::is_fullscreen(), SPDesktopWidget::menubar, SPDesktopWidget::panels, SPDesktopWidget::snap_toolbox, SPDesktopWidget::statusbar, SPDesktopWidget::tool_toolbox, SPDesktopWidget::vruler, and SPDesktopWidget::vscrollbar_box.

Referenced by sp_desktop_widget_new().

{
    Glib::ustring pref_root;
    Inkscape::Preferences *prefs = Inkscape::Preferences::get();

    if (dtw->desktop->is_focusMode()) {
          pref_root = "/focus/";
    } else if (dtw->desktop->is_fullscreen()) {
          pref_root = "/fullscreen/";
    } else {
          pref_root = "/window/";
    }

#ifndef GDK_WINDOWING_QUARTZ
    if (!prefs->getBool(pref_root + "menu/state", true)) {
        gtk_widget_hide_all (dtw->menubar);
    } else {
        gtk_widget_show_all (dtw->menubar);
    }
#endif

    if (!prefs->getBool(pref_root + "commands/state", true)) {
        gtk_widget_hide_all (dtw->commands_toolbox);
    } else {
        gtk_widget_show_all (dtw->commands_toolbox);
    }

    if (!prefs->getBool(pref_root + "snaptoolbox/state", true)) {
            gtk_widget_hide_all (dtw->snap_toolbox);
      } else {
            gtk_widget_show_all (dtw->snap_toolbox);
      }

    if (!prefs->getBool(pref_root + "toppanel/state", true)) {
        gtk_widget_hide_all (dtw->aux_toolbox);
    } else {
        // we cannot just show_all because that will show all tools' panels;
        // this is a function from toolbox.cpp that shows only the current tool's panel
        show_aux_toolbox (dtw->aux_toolbox);
    }

    if (!prefs->getBool(pref_root + "toolbox/state", true)) {
        gtk_widget_hide_all (dtw->tool_toolbox);
    } else {
        gtk_widget_show_all (dtw->tool_toolbox);
    }

    if (!prefs->getBool(pref_root + "statusbar/state", true)) {
        gtk_widget_hide_all (dtw->statusbar);
    } else {
        gtk_widget_show_all (dtw->statusbar);
    }

    if (!prefs->getBool(pref_root + "panels/state", true)) {
        gtk_widget_hide_all( GTK_WIDGET(dtw->panels->gobj()) );
    } else {
        gtk_widget_show_all( GTK_WIDGET(dtw->panels->gobj()) );
    }

    if (!prefs->getBool(pref_root + "scrollbars/state", true)) {
        gtk_widget_hide_all (dtw->hscrollbar);
        gtk_widget_hide_all (dtw->vscrollbar_box);
        gtk_widget_hide_all( dtw->cms_adjust );
    } else {
        gtk_widget_show_all (dtw->hscrollbar);
        gtk_widget_show_all (dtw->vscrollbar_box);
        gtk_widget_show_all( dtw->cms_adjust );
    }

    if (!prefs->getBool(pref_root + "rulers/state", true)) {
        gtk_widget_hide_all (dtw->hruler);
        gtk_widget_hide_all (dtw->vruler);
    } else {
        gtk_widget_show_all (dtw->hruler);
        gtk_widget_show_all (dtw->vruler);
    }
}


Generated by  Doxygen 1.6.0   Back to index