Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 18306:4dadae02bd4c gui-release
max. width of editor tabs limited and configurable
* settings-dialog.ui: new spin box for max. tab width
* settings-dialog.cc (constructor): set spin box value from settings file;
(write_changed_settings): write spin box value into settings file
* file-editor.cc (construct): set right text alignment in editor tabs;
(notice_settings): set tab's style sheet depending on tab width
author | Torsten <ttl@justmail.de> |
---|---|
date | Tue, 14 Jan 2014 22:51:43 +0100 |
parents | f227bb47314f |
children | 01646e48a650 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -842,6 +842,13 @@ { int icon_size = settings->value ("toolbar_icon_size", 16).toInt (); _tool_bar->setIconSize (QSize (icon_size, icon_size)); + + int tab_width = settings->value ("editor/tab_width", 300).toInt (); + QString style_sheet = QString ("QTabBar::tab {max-height: 4ex; " + "max-width: %1px; text-align: right }"). + arg (tab_width); + _tab_widget->setStyleSheet (style_sheet); + // Relay signal to file editor tabs. emit fetab_settings_changed (settings); } @@ -874,8 +881,7 @@ #ifdef HAVE_QTABWIDGET_SETMOVABLE _tab_widget->setMovable (true); #endif - _tab_widget->setStyleSheet ("QTabBar::tab {max-height: 4ex; }"); - + _tab_widget->setElideMode (Qt::ElideLeft); QAction *new_action = new QAction (QIcon (":/actions/icons/filenew.png"),