File tree Expand file tree Collapse file tree 5 files changed +16
-5
lines changed
Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 476476 <file>themes/default/cadtools/lock.png</file>
477477 <file>themes/default/cadtools/parallel.png</file>
478478 <file>themes/default/cadtools/perpendicular.png</file>
479+ <file>themes/default/mIconSuccess.png</file>
479480 </qresource>
480481 <qresource prefix="/images/tips">
481482 <file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class QgsMessageBar: QFrame
1010 INFO,
1111 WARNING,
1212 CRITICAL,
13+ SUCCESS
1314 };
1415
1516 QgsMessageBar( QWidget *parent = 0 );
@@ -24,7 +25,7 @@ class QgsMessageBar: QFrame
2425 /*! display a widget as a message on the bar after hiding the currently visible one
2526 * and putting it in a stack.
2627 * @param widget message widget to display
27- * @param level is QgsMessageBar::INFO, WARNING or CRITICAL
28+ * @param level is QgsMessageBar::INFO, WARNING, CRITICAL or SUCCESS
2829 * @param duration timeout duration of message in seconds, 0 value indicates no timeout
2930 */
3031 QgsMessageBarItem *pushWidget( QWidget *widget /Transfer/, MessageLevel level = INFO, int duration = 0 );
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ class GUI_EXPORT QgsMessageBar: public QFrame
4848 {
4949 INFO = 0 ,
5050 WARNING = 1 ,
51- CRITICAL = 2
51+ CRITICAL = 2 ,
52+ SUCCESS = 3
5253 };
5354
5455 QgsMessageBar ( QWidget *parent = 0 );
@@ -63,7 +64,7 @@ class GUI_EXPORT QgsMessageBar: public QFrame
6364 /* ! display a widget as a message on the bar after hiding the currently visible one
6465 * and putting it in a stack.
6566 * @param widget message widget to display
66- * @param level is QgsMessageBar::INFO, WARNING or CRITICAL
67+ * @param level is QgsMessageBar::INFO, WARNING, CRITICAL or SUCCESS
6768 * @param duration timeout duration of message in seconds, 0 value indicates no timeout
6869 */
6970 QgsMessageBarItem *pushWidget ( QWidget *widget, MessageLevel level = INFO, int duration = 0 );
Original file line number Diff line number Diff line change @@ -111,6 +111,9 @@ void QgsMessageBarItem::writeContent()
111111 case QgsMessageBar::WARNING:
112112 msgIcon = QString ( " /mIconWarn.png" );
113113 break ;
114+ case QgsMessageBar::SUCCESS:
115+ msgIcon = QString ( " /mIconSuccess.png" );
116+ break ;
114117 default :
115118 break ;
116119 }
@@ -167,7 +170,12 @@ void QgsMessageBarItem::writeContent()
167170 }
168171
169172 // STYLESHEET
170- if ( mLevel >= QgsMessageBar::CRITICAL )
173+ if ( mLevel == QgsMessageBar::SUCCESS )
174+ {
175+ mStyleSheet = " QgsMessageBar { background-color: #dff0d8; border: 1px solid #8e998a; } "
176+ " QLabel,QTextEdit { color: black; } " ;
177+ }
178+ else if ( mLevel == QgsMessageBar::CRITICAL )
171179 {
172180 mStyleSheet = " QgsMessageBar { background-color: #d65253; border: 1px solid #9b3d3d; } "
173181 " QLabel,QTextEdit { color: white; } " ;
@@ -177,7 +185,7 @@ void QgsMessageBarItem::writeContent()
177185 mStyleSheet = " QgsMessageBar { background-color: #ffc800; border: 1px solid #e0aa00; } "
178186 " QLabel,QTextEdit { color: black; } " ;
179187 }
180- else if ( mLevel < = QgsMessageBar::INFO )
188+ else if ( mLevel = = QgsMessageBar::INFO )
181189 {
182190 mStyleSheet = " QgsMessageBar { background-color: #e7f5fe; border: 1px solid #b9cfe4; } "
183191 " QLabel,QTextEdit { color: #2554a1; } " ;
You can’t perform that action at this time.
0 commit comments