mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
3387ccc6f6
commit
a27f67c026
28 changed files with 387 additions and 323 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue