1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Implement color selection.

This commit is contained in:
Sergey Lipskiy 2015-02-04 11:27:14 +06:00
parent e49eff9947
commit 36bee6f0f7
3 changed files with 33 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#include <QFontDialog>
#include <QColorDialog>
#include "ConfigDialog.h"
#include "ui_configDialog.h"
#include "FullscreenResolutions.h"
@ -221,6 +222,14 @@ void ConfigDialog::accept()
#else
config.font.name = fontName.toStdString();
#endif
config.font.color[0] = m_color.red();
config.font.color[1] = m_color.green();
config.font.color[2] = m_color.blue();
config.font.color[3] = m_color.alpha();
config.font.colorf[0] = m_color.redF();
config.font.colorf[1] = m_color.greenF();
config.font.colorf[2] = m_color.blueF();
config.font.colorf[3] = m_color.alphaF();
QDialog::accept();
}
@ -239,3 +248,18 @@ void ConfigDialog::on_selectFontButton_clicked()
ui->fontNameLabel->setText(m_font.family() + " - " + strSize);
ui->fontColorLabel->setFont(m_font);
}
void ConfigDialog::on_PickFontColorButton_clicked()
{
const QColor color = QColorDialog::getColor(m_color, this);
if (!color.isValid())
return;
m_color = color;
QPalette palette;
palette.setColor(QPalette::Window, Qt::black);
palette.setColor(QPalette::WindowText, m_color);
ui->fontColorLabel->setText(m_color.name());
ui->fontColorLabel->setPalette(palette);
}

View File

@ -23,6 +23,8 @@ public Q_SLOTS:
private slots:
void on_selectFontButton_clicked();
void on_PickFontColorButton_clicked();
private:
Ui::ConfigDialog *ui;
QFont m_font;

View File

@ -874,6 +874,9 @@
<property name="text">
<string>Arial</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
@ -884,6 +887,9 @@
<property name="text">
<string>Green</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
@ -944,7 +950,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select path to HD textures packs&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Select</string>
<string>Choose</string>
</property>
</widget>
</item>