Commit 6c700860 authored by JanKusanagi's avatar JanKusanagi

Remember CharacterPicker window size, use proper icon and modality

parent 75993fe9
......@@ -24,8 +24,18 @@
CharacterPicker::CharacterPicker(QWidget *parent) : QWidget(parent)
{
this->setWindowTitle(tr("Select a symbol") + " - Dianara");
this->setWindowIcon(QIcon::fromTheme("face-smile",
QIcon(":/images/button-symbols.png")));
this->setWindowFlags(Qt::Dialog);
//this->setWindowModality(Qt::ApplicationModal);
this->setWindowModality(Qt::ApplicationModal);
QSettings settings;
QSize savedWindowsize = settings.value("CharacterPicker/charPickerWindowSize")
.toSize();
if (savedWindowsize.isValid())
{
this->resize(savedWindowsize);
}
m_charSelect = new KCharSelect(this, KCharSelect::CharacterTable
| KCharSelect::BlockCombos
......@@ -68,3 +78,17 @@ void CharacterPicker::onCodePointChanged(uint codepoint)
this->deleteLater();
}
//////////////////////////////////////////////////////////////////////////////
/////////////////////////////// PROTECTED ////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
void CharacterPicker::closeEvent(QCloseEvent *event)
{
QSettings settings;
settings.setValue("CharacterPicker/charPickerWindowSize", this->size());
event->accept();
}
......@@ -25,6 +25,8 @@
#include <QVBoxLayout>
#include <KCharSelect>
#include <QPushButton>
#include <QCloseEvent>
#include <QSettings>
#include <QDebug>
......@@ -45,6 +47,10 @@ public slots:
void onCodePointChanged(uint codepoint);
protected:
virtual void closeEvent(QCloseEvent *event);
private:
QVBoxLayout *m_mainLayout;
KCharSelect *m_charSelect;
......
......@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
#endif
#ifdef HAVE_KCHARSELECT
std::cout << QString("* Built with KCharSelect symbol selection support.\n")
std::cout << QString("* Built with KCharSelect character selection support.\n")
.toStdString();
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment