comparison libgui/src/workspace-model.h @ 16610:a1f613e5066d

workspace view colors based upon variable scope (derived from Dan's patch #8013) * resource-manager.cc/.h(storage_class_names): function returning scope names (storage_class_colors): function returning default colors for scopes (storage_class_chars): function returning the ident. characters of the scopes * color-picker.cc(constructor): prevent focus for the colored pushbutton * settings-dialog.cc/.h(read_workspace_colors): function reading the colors from the setitngs and creating a table with color-pickers in the settings dialog (write_wirkspace_colors): function getting the states of the color-pickers and writing them into the settings files * settings-dialog.cc(constructor): call read_workspace_colors (write_changed_settings): call write_workspace_colors * settings-dialog.ui: new tab for workspace settings with a box for the colors * workspace_model.cc/.h(notice_settings): reading colors from the settings * workspace-model.cc(constructor): initialize list of colors (data): reorganize determining the appropriate data and take background color role into consideration * workspace-model.h(storage_class_color): returns the color for a specific scope * workspace-view.cc/.h(notice_settings): create tool tip with color key (setModel): not inline anymore, actual model is stored in _model
author Torsten <ttl@justmail.de>
date Sat, 04 May 2013 09:37:28 +0200
parents 45ae1038ee89
children 64f9a3e301d3
comparison
equal deleted inserted replaced
16609:6f7940e36322 16610:a1f613e5066d
26 26
27 #include <QAbstractTableModel> 27 #include <QAbstractTableModel>
28 #include <QVector> 28 #include <QVector>
29 #include <QSemaphore> 29 #include <QSemaphore>
30 #include <QStringList> 30 #include <QStringList>
31 #include <QChar>
32 #include <QColor>
33 #include <QSettings>
31 34
32 class workspace_model 35 class workspace_model
33 : public QAbstractTableModel 36 : public QAbstractTableModel
34 { 37 {
35 Q_OBJECT 38 Q_OBJECT
54 57
55 int columnCount (const QModelIndex& parent = QModelIndex ()) const; 58 int columnCount (const QModelIndex& parent = QModelIndex ()) const;
56 59
57 bool is_top_level (void) const { return _top_level; } 60 bool is_top_level (void) const { return _top_level; }
58 61
62 QColor storage_class_color (int s_class) { return _storage_class_colors.at (s_class); }
63
59 public slots: 64 public slots:
60 65
61 void set_workspace (bool top_level, 66 void set_workspace (bool top_level,
62 const QString& scopes, 67 const QString& scopes,
63 const QStringList& symbols, 68 const QStringList& symbols,
64 const QStringList& class_names, 69 const QStringList& class_names,
65 const QStringList& dimensions, 70 const QStringList& dimensions,
66 const QStringList& values); 71 const QStringList& values);
67 72
68 void clear_workspace (void); 73 void clear_workspace (void);
74
75 void notice_settings (const QSettings *);
69 76
70 signals: 77 signals:
71 78
72 void model_changed (void); 79 void model_changed (void);
73 80
84 QStringList _class_names; 91 QStringList _class_names;
85 QStringList _dimensions; 92 QStringList _dimensions;
86 QStringList _values; 93 QStringList _values;
87 94
88 QStringList _columnNames; 95 QStringList _columnNames;
96
97 QList<QColor> _storage_class_colors;
98
89 }; 99 };
90 100
91 #endif 101 #endif