summaryrefslogtreecommitdiffstats
path: root/qt-ui/tagwidget.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 11:50:56 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 11:50:56 +0700
commita27f67c02612791fad73b4e0550d942dc3a5a339 (patch)
tree4417a2be34c8bcd7c03db23ba5f307ad463657a9 /qt-ui/tagwidget.cpp
parent3387ccc6f676636fe3fb8b11c8c371f627d74551 (diff)
downloadsubsurface-a27f67c02612791fad73b4e0550d942dc3a5a339.tar.gz
Whitespace and coding style updates
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/tagwidget.cpp')
-rw-r--r--qt-ui/tagwidget.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp
index 4aa997c4c..dc78c8997 100644
--- a/qt-ui/tagwidget.cpp
+++ b/qt-ui/tagwidget.cpp
@@ -14,17 +14,15 @@ TagWidget::TagWidget(QWidget *parent) : GroupedLineEdit(parent), m_completer(NUL
qreal h, s, l, a;
textColor.getHslF(&h, &s, &l, &a);
// I use dark themes
- if (l <= 0.3 ){ // very dark text. get a brigth background
+ if (l <= 0.3 ) { // very dark text. get a brigth background
addColor( QColor(Qt::red).lighter(120) );
addColor( QColor(Qt::green).lighter(120) );
addColor( QColor(Qt::blue).lighter(120) );
- }
- else if ( l <= 0.6 ){ // moderated dark text. get a somewhat brigth background
+ } else if ( l <= 0.6 ) { // moderated dark text. get a somewhat brigth background
addColor( QColor(Qt::red).lighter(60) );
addColor( QColor(Qt::green).lighter(60) );
addColor( QColor(Qt::blue).lighter(60) );
- }
- else{
+ } else {
addColor( QColor(Qt::red).darker(120) );
addColor( QColor(Qt::green).darker(120) );
addColor( QColor(Qt::blue).darker(120) );
@@ -80,7 +78,7 @@ void TagWidget::highlight() {
} else if (state == FINDEND) {
/* Found end of tag */
if (i > 1) {
- if(text().at(i-1) != '\\') {
+ if (text().at(i-1) != '\\') {
addBlock(start, end);
state = FINDSTART;
}
@@ -125,10 +123,9 @@ void TagWidget::reparse()
QAbstractItemView *popup = m_completer->popup();
if (popup)
popup->hide();
- }
- else
+ } else {
m_completer->complete();
-
+ }
} else {
m_completer->complete();
}
@@ -141,8 +138,7 @@ void TagWidget::completionSelected(QString completion) {
if (pos.first >= 0 && pos.second > 0) {
setText(text().remove(pos.first, pos.second-pos.first).insert(pos.first, completion));
setCursorPosition(pos.first+completion.length());
- }
- else {
+ } else {
setText(completion.append(", "));
setCursorPosition(text().length());
}