Mercurial > octave-nkf
changeset 19076:110702c507e3 gui-release
user setting for hiding the tool tip in the workspace view (part of bug #42306)
* settings-dialog.ui: new checkbox for hiding the tool tip in workspace pane
* settings-dialog.cc (constructor): set new checkbox according to settings;
(write_changed_settings): write checkbox state into settings file
* workspace-view.cc (notice-settings): set an empty tool tip if the user
wants to hide the tool tip
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 23 Aug 2014 13:19:12 +0200 |
parents | dddffa2ff413 |
children | 2e6b34324d50 |
files | libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui libgui/src/workspace-view.cc |
diffstat | 3 files changed, 34 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/settings-dialog.cc Thu Aug 14 09:16:16 2014 +0200 +++ b/libgui/src/settings-dialog.cc Sat Aug 23 13:19:12 2014 +0200 @@ -281,8 +281,12 @@ ui->proxyUserName->setText (settings->value ("proxyUserName").toString ()); ui->proxyPassword->setText (settings->value ("proxyPassword").toString ()); - // qorkspace colors + // Workspace + // colors read_workspace_colors (settings); + // hide tool tips + ui->cb_hide_tool_tips->setChecked ( + settings->value ("workspaceview/hide_tool_tips",false).toBool ()); // terminal colors read_terminal_colors (settings); @@ -731,8 +735,13 @@ delete lexer; #endif + // Workspace write_workspace_colors (settings); + // hide tool tips + settings->setValue ("workspaceview/hide_tool_tips", + ui->cb_hide_tool_tips->isChecked ()); + // Terminal write_terminal_colors (settings); // shortcuts
--- a/libgui/src/settings-dialog.ui Thu Aug 14 09:16:16 2014 +0200 +++ b/libgui/src/settings-dialog.ui Sat Aug 23 13:19:12 2014 +0200 @@ -32,7 +32,7 @@ </size> </property> <property name="currentIndex"> - <number>1</number> + <number>5</number> </property> <widget class="QWidget" name="tab_general"> <property name="enabled"> @@ -404,7 +404,7 @@ <property name="geometry"> <rect> <x>0</x> - <y>-175</y> + <y>0</y> <width>662</width> <height>580</height> </rect> @@ -1659,8 +1659,11 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_19"> <item> - <layout class="QVBoxLayout" name="verticalLayout_13"> - <item> + <layout class="QGridLayout" name="gridLayout_14"> + <property name="topMargin"> + <number>0</number> + </property> + <item row="0" column="0"> <widget class="QGroupBox" name="workspace_colors_box"> <property name="enabled"> <bool>true</bool> @@ -1682,16 +1685,10 @@ </property> </widget> </item> - <item> - <widget class="Line" name="line_8"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>1</height> - </size> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <item row="1" column="0"> + <widget class="QCheckBox" name="cb_hide_tool_tips"> + <property name="text"> + <string>Hide tool tip</string> </property> </widget> </item>
--- a/libgui/src/workspace-view.cc Thu Aug 14 09:16:16 2014 +0200 +++ b/libgui/src/workspace-view.cc Sat Aug 23 13:19:12 2014 +0200 @@ -257,16 +257,22 @@ _model->notice_settings (settings); // update colors of model first QString tool_tip; - tool_tip = QString (tr ("View the variables in the active workspace.<br>")); - tool_tip += QString (tr ("Colors for variable attributes:")); - for (int i = 0; i < resource_manager::storage_class_chars ().length (); i++) + + if (!settings->value ("workspaceview/hide_tool_tips",false).toBool ()) { - tool_tip += - QString ("<div style=\"background-color:%1;color:#000000\">%2</div>") - .arg (_model->storage_class_color (i).name ()) - .arg (resource_manager::storage_class_names ().at (i)); + tool_tip = QString (tr ("View the variables in the active workspace.<br>")); + tool_tip += QString (tr ("Colors for variable attributes:")); + for (int i = 0; i < resource_manager::storage_class_chars ().length (); i++) + { + tool_tip += + QString ("<div style=\"background-color:%1;color:#000000\">%2</div>") + .arg (_model->storage_class_color (i).name ()) + .arg (resource_manager::storage_class_names ().at (i)); + } } + setToolTip (tool_tip); + } void