mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Fixed default font in utilities
This commit is contained in:
parent
fd54db5e16
commit
c9ffce91a7
@ -32,14 +32,13 @@ struct tQucsSettings QucsSettings;
|
||||
// Loads the settings file and stores the settings.
|
||||
bool loadSettings()
|
||||
{
|
||||
QSettings settings("qucs","qucs");
|
||||
QSettings settings("qucs","qucs_s");
|
||||
settings.beginGroup("QucsActiveFilter");
|
||||
if(settings.contains("x"))QucsSettings.x=settings.value("x").toInt();
|
||||
if(settings.contains("y"))QucsSettings.y=settings.value("y").toInt();
|
||||
if(settings.contains("showConsole")) QucsSettings.showConsole=settings.value("showConsole").toBool();
|
||||
settings.endGroup();
|
||||
|
||||
if(settings.contains("font"))QucsSettings.font.fromString(settings.value("font").toString());
|
||||
if(settings.contains("Language"))QucsSettings.Language=settings.value("Language").toString();
|
||||
|
||||
return true;
|
||||
@ -50,7 +49,7 @@ bool loadSettings()
|
||||
// Saves the settings in the settings file.
|
||||
bool saveApplSettings(QucsActiveFilter *qucs)
|
||||
{
|
||||
QSettings settings ("qucs","qucs");
|
||||
QSettings settings ("qucs","qucs_s");
|
||||
settings.beginGroup("QucsActiveFilter");
|
||||
settings.setValue("x", qucs->x());
|
||||
settings.setValue("y", qucs->y());
|
||||
@ -69,7 +68,6 @@ int main(int argc, char *argv[])
|
||||
// apply default settings
|
||||
QucsSettings.x = 200;
|
||||
QucsSettings.y = 100;
|
||||
QucsSettings.font = QFont("Helvetica", 12);
|
||||
QucsSettings.showConsole = true;
|
||||
|
||||
// is application relocated?
|
||||
@ -85,8 +83,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
loadSettings();
|
||||
|
||||
a.setFont(QucsSettings.font);
|
||||
|
||||
QTranslator tor( 0 );
|
||||
QString Lang = QucsSettings.Language;
|
||||
if(Lang.isEmpty())
|
||||
|
@ -35,7 +35,7 @@ struct tQucsSettings QucsSettings;
|
||||
// Loads the settings file and stores the settings.
|
||||
bool loadSettings()
|
||||
{
|
||||
QSettings settings("qucs","qucs");
|
||||
QSettings settings("qucs","qucs_s");
|
||||
settings.beginGroup("QucsAttenuator");
|
||||
if(settings.contains("x"))QucsSettings.x=settings.value("x").toInt();
|
||||
if(settings.contains("y"))QucsSettings.y=settings.value("y").toInt();
|
||||
@ -51,7 +51,7 @@ bool loadSettings()
|
||||
// Saves the settings in the settings file.
|
||||
bool saveApplSettings(QucsAttenuator *qucs)
|
||||
{
|
||||
QSettings settings ("qucs","qucs");
|
||||
QSettings settings ("qucs","qucs_s");
|
||||
settings.beginGroup("QucsAttenuator");
|
||||
settings.setValue("x", qucs->x());
|
||||
settings.setValue("y", qucs->y());
|
||||
@ -69,7 +69,6 @@ int main( int argc, char ** argv )
|
||||
// apply default settings
|
||||
QucsSettings.x = 200;
|
||||
QucsSettings.y = 100;
|
||||
QucsSettings.font = QFont("Helvetica", 12);
|
||||
|
||||
// is application relocated?
|
||||
char * var = getenv ("QUCSDIR");
|
||||
@ -92,7 +91,6 @@ int main( int argc, char ** argv )
|
||||
|
||||
loadSettings();
|
||||
|
||||
a.setFont(QucsSettings.font);
|
||||
QTranslator tor( 0 );
|
||||
QString lang = QucsSettings.Language;
|
||||
if(lang.isEmpty())
|
||||
|
@ -42,12 +42,11 @@ struct tQucsSettings QucsSettings;
|
||||
// Loads the settings file and stores the settings.
|
||||
bool loadSettings()
|
||||
{
|
||||
QSettings settings("qucs","qucs");
|
||||
QSettings settings("qucs","qucs_s");
|
||||
settings.beginGroup("QucsFilter");
|
||||
if(settings.contains("x"))QucsSettings.x=settings.value("x").toInt();
|
||||
if(settings.contains("y"))QucsSettings.y=settings.value("y").toInt();
|
||||
settings.endGroup();
|
||||
if(settings.contains("font"))QucsSettings.font.fromString(settings.value("font").toString());
|
||||
if(settings.contains("Language"))QucsSettings.Language=settings.value("Language").toString();
|
||||
|
||||
return true;
|
||||
@ -58,7 +57,7 @@ bool loadSettings()
|
||||
// Saves the settings in the settings file.
|
||||
bool saveApplSettings(QucsFilter *qucs)
|
||||
{
|
||||
QSettings settings ("qucs","qucs");
|
||||
QSettings settings ("qucs","qucs_s");
|
||||
settings.beginGroup("QucsFilter");
|
||||
settings.setValue("x", qucs->x());
|
||||
settings.setValue("y", qucs->y());
|
||||
@ -82,7 +81,6 @@ int main(int argc, char *argv[])
|
||||
// apply default settings
|
||||
QucsSettings.x = 200;
|
||||
QucsSettings.y = 100;
|
||||
QucsSettings.font = QFont("Helvetica", 12);
|
||||
|
||||
// is application relocated?
|
||||
QDir QucsDir;
|
||||
@ -97,8 +95,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
loadSettings();
|
||||
|
||||
a.setFont(QucsSettings.font);
|
||||
|
||||
QTranslator tor( 0 );
|
||||
QString lang = QucsSettings.Language;
|
||||
if(lang.isEmpty())
|
||||
|
@ -42,7 +42,7 @@ QDir SysLibDir;
|
||||
// Loads the settings file and stores the settings.
|
||||
bool loadSettings()
|
||||
{
|
||||
QSettings settings("qucs","qucs");
|
||||
QSettings settings("qucs","qucs_s");
|
||||
// Qucs Library Tool specific settings
|
||||
settings.beginGroup("QucsLib");
|
||||
if(settings.contains("x"))QucsSettings.x=settings.value("x").toInt();
|
||||
@ -68,7 +68,7 @@ bool loadSettings()
|
||||
// Saves the settings in the settings file.
|
||||
bool saveApplSettings(QucsLib *qucs)
|
||||
{
|
||||
QSettings settings ("qucs","qucs");
|
||||
QSettings settings ("qucs","qucs_s");
|
||||
settings.beginGroup("QucsLib");
|
||||
settings.setValue("x", qucs->x());
|
||||
settings.setValue("y", qucs->y());
|
||||
@ -115,8 +115,6 @@ int main(int argc, char *argv[])
|
||||
SysLibDir.setPath(QucsSettings.LibDir);
|
||||
UserLibDir.setPath(QucsSettings.QucsHomeDir.canonicalPath() + "/user_lib/");
|
||||
|
||||
a.setFont(QucsSettings.font);
|
||||
|
||||
QTranslator tor( 0 );
|
||||
QString lang = QucsSettings.Language;
|
||||
if(lang.isEmpty())
|
||||
|
@ -46,6 +46,7 @@ SymbolWidget::SymbolWidget(QWidget *parent) : QWidget(parent)
|
||||
y1 = 0;
|
||||
y2 = 0;
|
||||
PaintText = tr("Symbol:");
|
||||
setFont(QucsSettings.font);
|
||||
QFontMetrics metrics(QucsSettings.font, 0); // use the the screen-compatible metric
|
||||
TextWidth = metrics.width(PaintText) + 4; // get size of text
|
||||
|
||||
|
@ -701,7 +701,8 @@ void QucsSettingsDialog::slotBGColorDialog()
|
||||
void QucsSettingsDialog::slotDefaultValues()
|
||||
{
|
||||
QPalette p;
|
||||
Font = QFont("Helvetica", 12);
|
||||
Font = QApplication::font();
|
||||
Font.setPointSize(12);
|
||||
FontButton->setText(Font.toString());
|
||||
LargeFontSizeEdit->setText(QString::number(16.0));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user