Skip to content

Commit

Permalink
removed ugly font preview label
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyKoyle committed Feb 10, 2017
1 parent e486efb commit f747a80
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
9 changes: 3 additions & 6 deletions source/urxvtconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,14 @@ URXVTConfig::URXVTConfig(QWidget *parent) :
QFile configFile(configFilePath);
QFile databaseFile(databaseFilePath);

if(configFile.exists()){
if(!configFile.exists()){

}else{
configFile.open(QIODevice::ReadWrite);
QTextStream stream(&configFile);
stream << "no_warnings: false" << endl << "no_backups: false" << endl;
configFile.close();
}
if(databaseFile.exists()){

}else{
if(!databaseFile.exists()){
databaseFile.open(QIODevice::ReadWrite);
QTextStream stream(&databaseFile);
stream << "Example Preset: #93a1a1,#002b36,#93a1a1,#002b36,#657b83,#dc322f,#dc322f,#859900,#859900,#b58900,#b58900,#268bd2,#268bd2,#6c71c4,#6c71c4,#2aa198,#2aa198,#93a1a1,#fdf6e3" << endl;
Expand Down Expand Up @@ -639,7 +636,7 @@ void URXVTConfig::openFromFile(QString target)
}else if(line.startsWith("URxvt.font:")){
ui->spinBoxFontSize->setValue(line.mid(line.length()-3, 2).toInt());
line = line.mid(16);
ui->labelCurrentFont->setText(line.left(line.length() - 14));
ui->fontComboBox->setCurrentFont(line.left(line.length() - 14));
}else if(line.startsWith("URxvt.boldFont:")){
ui->checkBoxFontBoldDisable->setChecked(true);
}else if(line.startsWith("URxvt.letterSpa")){
Expand Down
45 changes: 31 additions & 14 deletions source/urxvtconfig.ui
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,37 @@
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QLabel" name="labelPreviewRow1">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>1.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelPreviewInclude">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>#include</string>
</property>
Expand Down Expand Up @@ -920,21 +944,14 @@
</item>
<item row="7" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_29">
<item>
<widget class="QLabel" name="labelCurrentFont">
<property name="toolTip">
<string>This is the current font.</string>
</property>
<property name="text">
<string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>125</width>
Expand All @@ -943,7 +960,7 @@
</property>
<property name="maximumSize">
<size>
<width>125</width>
<width>131434</width>
<height>16777215</height>
</size>
</property>
Expand Down

0 comments on commit f747a80

Please sign in to comment.