aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorDenis Mulalic <demu4731@colordo.edu>2017-04-04 13:11:09 -0600
committerDenis Mulalic <demu4731@colordo.edu>2017-04-04 13:11:09 -0600
commitb31acc2e53202c20cdce752bd5b7b28aec9387d5 (patch)
treec38db73f31de4204a0730971aaf4b6b293756771 /src-qt5
parentMerge remote-tracking branch 'origin/master' (diff)
downloadlumina-b31acc2e53202c20cdce752bd5b7b28aec9387d5.tar.gz
lumina-b31acc2e53202c20cdce752bd5b7b28aec9387d5.tar.bz2
lumina-b31acc2e53202c20cdce752bd5b7b28aec9387d5.zip
added font size box
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.cpp11
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.h3
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/main.cpp4
3 files changed, 17 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
index b5790cc5..49314e1f 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
@@ -24,8 +24,12 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
fontbox->setFocusPolicy(Qt::NoFocus);
QWidget *spacer = new QWidget(this);
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ fontSizes = new QSpinBox(this);
+ fontSizes->setRange(5, 72);
+ fontSizes->setValue(9);
ui->toolBar->addWidget(spacer);
ui->toolBar->addWidget(fontbox);
+ ui->toolBar->addWidget(fontSizes);
//Load settings
settings = new QSettings("lumina-desktop","lumina-textedit");
if(settings->contains("lastfont")){
@@ -77,6 +81,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
connect(ui->line_replace, SIGNAL(returnPressed()), this, SLOT(replaceOne()) );
connect(colorDLG, SIGNAL(colorsChanged()), this, SLOT(UpdateHighlighting()) );
connect(fontbox, SIGNAL(currentFontChanged(const QFont&)), this, SLOT(fontChanged(const QFont&)) );
+ connect(fontSizes, SIGNAL(valueChanged(int)), this, SLOT(changeFontSize(int)));
updateIcons();
//Now load the initial size of the window
QSize lastSize = settings->value("lastSize",QSize()).toSize();
@@ -212,6 +217,12 @@ void MainUI::fontChanged(const QFont &font){
QApplication::setFont(font, "PlainTextEditor");
}
+void MainUI::changeFontSize(int newFontSize){
+ QFont currentFont = fontbox->currentFont();
+ currentFont.setPointSize(newFontSize);
+ QApplication::setFont(currentFont, "PlainTextEditor");
+}
+
void MainUI::updateStatusTip(){
QString msg = currentEditor()->statusTip();
//ui->statusbar->clearMessage();
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.h b/src-qt5/desktop-utils/lumina-textedit/MainUI.h
index 097b747e..69ea589c 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.h
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.h
@@ -12,6 +12,7 @@
#include <QSettings>
#include <QShortcut>
#include <QFontComboBox>
+#include <QSpinBox>
#include "PlainTextEditor.h"
#include "ColorDialog.h"
@@ -37,6 +38,7 @@ private:
ColorDialog *colorDLG;
QSettings *settings;
QShortcut *closeFindS;
+ QSpinBox *fontSizes;
//Simplification functions
PlainTextEditor* currentEditor();
@@ -51,6 +53,7 @@ private slots:
void SaveFileAs();
void fontChanged(const QFont &font);
void updateStatusTip();
+ void changeFontSize(int newFontSize);
//Other Menu Actions
void UpdateHighlighting(QAction *act = 0);
diff --git a/src-qt5/desktop-utils/lumina-textedit/main.cpp b/src-qt5/desktop-utils/lumina-textedit/main.cpp
index ec4503a0..61f6672e 100644
--- a/src-qt5/desktop-utils/lumina-textedit/main.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/main.cpp
@@ -18,12 +18,14 @@ int main(int argc, char *argv[]) {
LUtils::LoadTranslation(&a, "l-te");
//Now go ahead and setup the app
//LuminaThemeEngine theme(&a);
- QStringList args;
+ QStringList args; //list<string> in c++11 stl container.
for(int i=1; i<argc; i++){
+ // qDebug() << argv[i] << endl;
args << QString(argv[i]);
}
//Now start the window
MainUI W;
+
//QObject::connect(&theme, SIGNAL(updateIcons()), &W, SLOT(updateIcons()) );
W.LoadArguments(args);
W.show();
bgstack15