Skip to content

Commit f747a80

Browse files
committed
removed ugly font preview label
1 parent e486efb commit f747a80

2 files changed

Lines changed: 34 additions & 20 deletions

File tree

source/urxvtconfig.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,14 @@ URXVTConfig::URXVTConfig(QWidget *parent) :
7272
QFile configFile(configFilePath);
7373
QFile databaseFile(databaseFilePath);
7474

75-
if(configFile.exists()){
75+
if(!configFile.exists()){
7676

77-
}else{
7877
configFile.open(QIODevice::ReadWrite);
7978
QTextStream stream(&configFile);
8079
stream << "no_warnings: false" << endl << "no_backups: false" << endl;
8180
configFile.close();
8281
}
83-
if(databaseFile.exists()){
84-
85-
}else{
82+
if(!databaseFile.exists()){
8683
databaseFile.open(QIODevice::ReadWrite);
8784
QTextStream stream(&databaseFile);
8885
stream << "Example Preset: #93a1a1,#002b36,#93a1a1,#002b36,#657b83,#dc322f,#dc322f,#859900,#859900,#b58900,#b58900,#268bd2,#268bd2,#6c71c4,#6c71c4,#2aa198,#2aa198,#93a1a1,#fdf6e3" << endl;
@@ -639,7 +636,7 @@ void URXVTConfig::openFromFile(QString target)
639636
}else if(line.startsWith("URxvt.font:")){
640637
ui->spinBoxFontSize->setValue(line.mid(line.length()-3, 2).toInt());
641638
line = line.mid(16);
642-
ui->labelCurrentFont->setText(line.left(line.length() - 14));
639+
ui->fontComboBox->setCurrentFont(line.left(line.length() - 14));
643640
}else if(line.startsWith("URxvt.boldFont:")){
644641
ui->checkBoxFontBoldDisable->setChecked(true);
645642
}else if(line.startsWith("URxvt.letterSpa")){

source/urxvtconfig.ui

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,37 @@
6060
<layout class="QHBoxLayout" name="horizontalLayout_20">
6161
<item>
6262
<widget class="QLabel" name="labelPreviewRow1">
63+
<property name="minimumSize">
64+
<size>
65+
<width>20</width>
66+
<height>0</height>
67+
</size>
68+
</property>
69+
<property name="maximumSize">
70+
<size>
71+
<width>20</width>
72+
<height>16777215</height>
73+
</size>
74+
</property>
6375
<property name="text">
6476
<string>1.</string>
6577
</property>
6678
</widget>
6779
</item>
6880
<item>
6981
<widget class="QLabel" name="labelPreviewInclude">
82+
<property name="minimumSize">
83+
<size>
84+
<width>70</width>
85+
<height>0</height>
86+
</size>
87+
</property>
88+
<property name="maximumSize">
89+
<size>
90+
<width>70</width>
91+
<height>16777215</height>
92+
</size>
93+
</property>
7094
<property name="text">
7195
<string>#include</string>
7296
</property>
@@ -920,21 +944,14 @@
920944
</item>
921945
<item row="7" column="0">
922946
<layout class="QHBoxLayout" name="horizontalLayout_29">
923-
<item>
924-
<widget class="QLabel" name="labelCurrentFont">
925-
<property name="toolTip">
926-
<string>This is the current font.</string>
927-
</property>
928-
<property name="text">
929-
<string>-</string>
930-
</property>
931-
<property name="alignment">
932-
<set>Qt::AlignCenter</set>
933-
</property>
934-
</widget>
935-
</item>
936947
<item>
937948
<widget class="QFontComboBox" name="fontComboBox">
949+
<property name="sizePolicy">
950+
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
951+
<horstretch>0</horstretch>
952+
<verstretch>0</verstretch>
953+
</sizepolicy>
954+
</property>
938955
<property name="minimumSize">
939956
<size>
940957
<width>125</width>
@@ -943,7 +960,7 @@
943960
</property>
944961
<property name="maximumSize">
945962
<size>
946-
<width>125</width>
963+
<width>131434</width>
947964
<height>16777215</height>
948965
</size>
949966
</property>

0 commit comments

Comments
 (0)