mirror of
https://github.com/jorenchik/mdemory.git
synced 2026-03-22 00:26:21 +00:00
bigger font
This commit is contained in:
@@ -63,6 +63,7 @@
|
|||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
|
#include <QHeaderView>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
@@ -311,7 +312,7 @@ Mdem* makeMdem() {
|
|||||||
mdem->wMdem.setObjectName(id);
|
mdem->wMdem.setObjectName(id);
|
||||||
|
|
||||||
// Front
|
// Front
|
||||||
mdem->wFront.setMinimumHeight(60);
|
mdem->wFront.setMinimumHeight(70);
|
||||||
mdem->wFront.setLayout(&mdem->hFront);
|
mdem->wFront.setLayout(&mdem->hFront);
|
||||||
mdem->wFront.setProperty("first", "true");
|
mdem->wFront.setProperty("first", "true");
|
||||||
mdem->wMdem.setStyleSheet(QString(
|
mdem->wMdem.setStyleSheet(QString(
|
||||||
@@ -327,8 +328,12 @@ Mdem* makeMdem() {
|
|||||||
).arg(id, MDEM_BACKGROUND));
|
).arg(id, MDEM_BACKGROUND));
|
||||||
|
|
||||||
// Add Front Content
|
// Add Front Content
|
||||||
|
mdem->wFrontText.setWordWrap(true);
|
||||||
|
mdem->wFrontText.setSizePolicy(
|
||||||
|
QSizePolicy::Expanding,
|
||||||
|
QSizePolicy::Minimum
|
||||||
|
);
|
||||||
mdem->hFront.addWidget(&mdem->wFrontText);
|
mdem->hFront.addWidget(&mdem->wFrontText);
|
||||||
mdem->hFront.addStretch(1);
|
|
||||||
|
|
||||||
mdem->editButton.setText("Rediģēt");
|
mdem->editButton.setText("Rediģēt");
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
@@ -805,6 +810,7 @@ QMainWindow *initMdemListWindow() {
|
|||||||
QFileDialog *fileDialog = new QFileDialog;
|
QFileDialog *fileDialog = new QFileDialog;
|
||||||
|
|
||||||
QMenu *menu = new QMenu("Fails");
|
QMenu *menu = new QMenu("Fails");
|
||||||
|
menu->setStyleSheet("font-size: 15px;");
|
||||||
actionOpen = menu->addAction("Atvert memorybase");
|
actionOpen = menu->addAction("Atvert memorybase");
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
actionOpen,
|
actionOpen,
|
||||||
@@ -898,7 +904,7 @@ QMainWindow *initMdemListWindow() {
|
|||||||
wLabels->setLayout(vlLeftTop);
|
wLabels->setLayout(vlLeftTop);
|
||||||
wLabels->setMinimumSize(0, 40);
|
wLabels->setMinimumSize(0, 40);
|
||||||
|
|
||||||
QString labelStyle = "font-size: 17px; font-weight: 400;";
|
QString labelStyle = "font-size: 20px; font-weight: 400;";
|
||||||
// Memorybase label.
|
// Memorybase label.
|
||||||
membaseLabel = new QLabel();
|
membaseLabel = new QLabel();
|
||||||
membaseLabel->setStyleSheet(labelStyle);
|
membaseLabel->setStyleSheet(labelStyle);
|
||||||
@@ -917,6 +923,7 @@ QMainWindow *initMdemListWindow() {
|
|||||||
auto buttons = new QWidget();
|
auto buttons = new QWidget();
|
||||||
auto vlButtons = new QVBoxLayout();
|
auto vlButtons = new QVBoxLayout();
|
||||||
buttons->setLayout(vlButtons);
|
buttons->setLayout(vlButtons);
|
||||||
|
buttons->setStyleSheet("font-size: 15px;");
|
||||||
|
|
||||||
auto buttonsTop = new QWidget();
|
auto buttonsTop = new QWidget();
|
||||||
auto hlButtonsTop = new QHBoxLayout();
|
auto hlButtonsTop = new QHBoxLayout();
|
||||||
@@ -960,20 +967,23 @@ QMainWindow *initMdemListWindow() {
|
|||||||
toolbar->btnAdd.setText("Pievienot");
|
toolbar->btnAdd.setText("Pievienot");
|
||||||
toolbar->btnSave.setText("Saglabāt");
|
toolbar->btnSave.setText("Saglabāt");
|
||||||
toolbar->btnLoad.setText("Ielādēt");
|
toolbar->btnLoad.setText("Ielādēt");
|
||||||
toolbar->btnPractice.setText("Mācīties");
|
QLabel *algorithmLabel = new QLabel();
|
||||||
|
algorithmLabel->setText("Algoritms:");
|
||||||
toolbar->cbAlgorithm.addItem("Intervālu", SPACED);
|
toolbar->cbAlgorithm.addItem("Intervālu", SPACED);
|
||||||
toolbar->cbAlgorithm.addItem("Nejaušais", RANDOM);
|
toolbar->cbAlgorithm.addItem("Nejaušais", RANDOM);
|
||||||
toolbar->cbAlgorithm.addItem("Primārais", PRIMARY);
|
toolbar->cbAlgorithm.addItem("Primārais", PRIMARY);
|
||||||
|
toolbar->btnPractice.setText("Mācīties");
|
||||||
|
|
||||||
// Add buttons.
|
// Add buttons.
|
||||||
hlButtonsTop->addWidget(&toolbar->btnAdd);
|
hlButtonsTop->addWidget(&toolbar->btnAdd);
|
||||||
hlButtonsTop->addWidget(&toolbar->btnSave);
|
hlButtonsTop->addWidget(&toolbar->btnSave);
|
||||||
hlButtonsTop->addWidget(&toolbar->btnLoad);
|
hlButtonsTop->addWidget(&toolbar->btnLoad);
|
||||||
|
hlButtonsBottom->addWidget(algorithmLabel);
|
||||||
hlButtonsBottom->addWidget(&toolbar->cbAlgorithm);
|
hlButtonsBottom->addWidget(&toolbar->cbAlgorithm);
|
||||||
hlButtonsBottom->addWidget(&toolbar->btnPractice);
|
hlButtonsBottom->addWidget(&toolbar->btnPractice);
|
||||||
vlButtons->addWidget(buttonsTop);
|
vlButtons->addWidget(buttonsTop);
|
||||||
vlButtons->addWidget(buttonsBottom);
|
vlButtons->addWidget(buttonsBottom);
|
||||||
|
vlButtons->setAlignment(Qt::AlignTop);
|
||||||
|
|
||||||
// Style buttons
|
// Style buttons
|
||||||
hlButtonsTop->setContentsMargins(0, 0, 0, 0);
|
hlButtonsTop->setContentsMargins(0, 0, 0, 0);
|
||||||
@@ -993,28 +1003,40 @@ QMainWindow *initMdemListWindow() {
|
|||||||
|
|
||||||
model = new QFileSystemModel();
|
model = new QFileSystemModel();
|
||||||
mdemList = new QTreeView();
|
mdemList = new QTreeView();
|
||||||
|
|
||||||
|
QStringList filters;
|
||||||
|
filters << "*.mdem";
|
||||||
|
model->setNameFilters(filters);
|
||||||
|
model->setNameFilterDisables(false);
|
||||||
|
|
||||||
mdemList->setModel(model);
|
mdemList->setModel(model);
|
||||||
|
mdemList->setStyleSheet(
|
||||||
|
"font-size: 15px;"
|
||||||
|
);
|
||||||
|
auto header = mdemList->header();
|
||||||
|
header->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
currentPath = settings->value(SETTING_MEMORYBASE).toString();
|
currentPath = settings->value(SETTING_MEMORYBASE).toString();
|
||||||
if (currentPath.size() > 0) {
|
if (currentPath.size() > 0) {
|
||||||
pickDirectory(currentPath);
|
pickDirectory(currentPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*leftLayout->addWidget(leftTop);*/
|
/*leftLayout->addWidget(leftTop);*/
|
||||||
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
mdemList,
|
mdemList,
|
||||||
&QTreeView::doubleClicked,
|
&QTreeView::doubleClicked,
|
||||||
[](const QModelIndex &index) {
|
[](const QModelIndex &index) {
|
||||||
trainWindow->close();
|
|
||||||
auto fileInfo = model->fileInfo(index);
|
auto fileInfo = model->fileInfo(index);
|
||||||
|
if (fileInfo.suffix() == "mdem") {
|
||||||
|
trainWindow->close();
|
||||||
reloadMdem(fileInfo.filePath().toStdString());
|
reloadMdem(fileInfo.filePath().toStdString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int col = 1; col < model->columnCount(); ++col) {
|
for (int col = 1; col < model->columnCount(); ++col) {
|
||||||
mdemList->hideColumn(col);
|
mdemList->hideColumn(col);
|
||||||
}
|
}
|
||||||
/*model->setHeaderData(0, Qt::Horizontal, QObject::tr("Custom name"));*/
|
// TODO: name -> nosaukums in HEADER
|
||||||
leftLayout->addWidget(mdemList);
|
leftLayout->addWidget(mdemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1060,6 +1082,7 @@ QMainWindow *initMdemListWindow() {
|
|||||||
hMdemScroll = new QVBoxLayout();
|
hMdemScroll = new QVBoxLayout();
|
||||||
mdemScroll->setWidget(mdemContainer);
|
mdemScroll->setWidget(mdemContainer);
|
||||||
mdemScroll->setWidgetResizable(true);
|
mdemScroll->setWidgetResizable(true);
|
||||||
|
mdemScroll->setStyleSheet("font-size: 15px");
|
||||||
mdemContainer->setLayout(hMdemScroll);
|
mdemContainer->setLayout(hMdemScroll);
|
||||||
rightLayout->addWidget(mdemScroll);
|
rightLayout->addWidget(mdemScroll);
|
||||||
mdemSpacer = new QSpacerItem(
|
mdemSpacer = new QSpacerItem(
|
||||||
@@ -1077,6 +1100,7 @@ QMainWindow *initMdemListWindow() {
|
|||||||
auto hPagination = new QHBoxLayout();
|
auto hPagination = new QHBoxLayout();
|
||||||
|
|
||||||
wPagination->setLayout(hPagination);
|
wPagination->setLayout(hPagination);
|
||||||
|
wPagination->setStyleSheet("font-size: 15px;");
|
||||||
|
|
||||||
pagination->firstButton.setText(QString::fromStdString("<<"));
|
pagination->firstButton.setText(QString::fromStdString("<<"));
|
||||||
hPagination->addWidget(&pagination->firstButton);
|
hPagination->addWidget(&pagination->firstButton);
|
||||||
|
|||||||
@@ -83,15 +83,17 @@ QWidget *initSettings () {
|
|||||||
);
|
);
|
||||||
hlTop->addWidget(settingsLabel);
|
hlTop->addWidget(settingsLabel);
|
||||||
|
|
||||||
|
auto wForm = new QWidget;
|
||||||
auto formLayout = new QFormLayout;
|
auto formLayout = new QFormLayout;
|
||||||
|
wForm->setLayout(formLayout);
|
||||||
auto* mbaseInput = new QLineEdit;
|
auto mbaseInput = new QLineEdit;
|
||||||
auto* browseButton = new QPushButton("Izvēlēties");
|
auto browseButton = new QPushButton("Izvēlēties");
|
||||||
auto* pathLayout = new QHBoxLayout;
|
auto pathLayout = new QHBoxLayout;
|
||||||
pathLayout->addWidget(mbaseInput);
|
pathLayout->addWidget(mbaseInput);
|
||||||
pathLayout->addWidget(browseButton);
|
pathLayout->addWidget(browseButton);
|
||||||
formLayout->addRow("Noklusējuma memorybase:", pathLayout);
|
wForm->setStyleSheet("font-size: 15px;");
|
||||||
|
|
||||||
|
formLayout->addRow("Noklusējuma memorybase:", pathLayout);
|
||||||
QObject::connect(browseButton, &QPushButton::clicked, [mbaseInput]() {
|
QObject::connect(browseButton, &QPushButton::clicked, [mbaseInput]() {
|
||||||
QString dir = QFileDialog::getExistingDirectory(
|
QString dir = QFileDialog::getExistingDirectory(
|
||||||
nullptr,
|
nullptr,
|
||||||
@@ -137,12 +139,15 @@ QWidget *initSettings () {
|
|||||||
auto* showTimes = new QCheckBox;
|
auto* showTimes = new QCheckBox;
|
||||||
formLayout->addRow("Rādīt laikus komandrindā:", showTimes);
|
formLayout->addRow("Rādīt laikus komandrindā:", showTimes);
|
||||||
|
|
||||||
|
auto wButtons = new QWidget;
|
||||||
auto btnLayout = new QHBoxLayout;
|
auto btnLayout = new QHBoxLayout;
|
||||||
|
wButtons->setLayout(btnLayout);
|
||||||
auto btnSaveSettings = new QPushButton("Saglabāt");
|
auto btnSaveSettings = new QPushButton("Saglabāt");
|
||||||
auto btnLoad = new QPushButton("Ielādēt");
|
auto btnLoad = new QPushButton("Ielādēt");
|
||||||
auto mainLayout = new QVBoxLayout;
|
auto mainLayout = new QVBoxLayout;
|
||||||
btnLayout->addWidget(btnSaveSettings);
|
btnLayout->addWidget(btnSaveSettings);
|
||||||
btnLayout->addWidget(btnLoad);
|
btnLayout->addWidget(btnLoad);
|
||||||
|
wButtons->setStyleSheet("font-size: 15px;");
|
||||||
|
|
||||||
// @Improve: validate setting values
|
// @Improve: validate setting values
|
||||||
auto setSettingInputs = [
|
auto setSettingInputs = [
|
||||||
@@ -291,9 +296,9 @@ QWidget *initSettings () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
mainLayout->addWidget(top);
|
mainLayout->addWidget(top);
|
||||||
mainLayout->addLayout(formLayout);
|
mainLayout->addWidget(wForm);
|
||||||
mainLayout->addItem(spacer);
|
mainLayout->addItem(spacer);
|
||||||
mainLayout->addLayout(btnLayout);
|
mainLayout->addWidget(wButtons);
|
||||||
|
|
||||||
settingsWindow->setLayout(mainLayout);
|
settingsWindow->setLayout(mainLayout);
|
||||||
return settingsWindow;
|
return settingsWindow;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const auto listStyle =
|
|||||||
"QListView {"
|
"QListView {"
|
||||||
" background-color: white;"
|
" background-color: white;"
|
||||||
" border: 0px solid black;"
|
" border: 0px solid black;"
|
||||||
|
" font-size: 15px;"
|
||||||
"}"
|
"}"
|
||||||
"QListView::item::first {"
|
"QListView::item::first {"
|
||||||
" padding: 5px 0 0 0;"
|
" padding: 5px 0 0 0;"
|
||||||
@@ -64,6 +65,12 @@ const auto listStyle =
|
|||||||
" margin-left: 0px;"
|
" margin-left: 0px;"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
|
const QString buttonStyle =
|
||||||
|
"QToolButton {"
|
||||||
|
"padding: 4px 5px;"
|
||||||
|
"font-size: 15px;"
|
||||||
|
"}";
|
||||||
|
|
||||||
class CustomItemDelegate : public QStyledItemDelegate {
|
class CustomItemDelegate : public QStyledItemDelegate {
|
||||||
public:
|
public:
|
||||||
CustomItemDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent) {}
|
CustomItemDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent) {}
|
||||||
@@ -478,9 +485,6 @@ void setupGroupQuestion(GroupQuestion *question) {
|
|||||||
return groupView;
|
return groupView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*auto getOrMakeGroup = [](int i) {*/
|
|
||||||
/*};*/
|
|
||||||
for (int k = 0; k < groupViews.size(); k++) {
|
for (int k = 0; k < groupViews.size(); k++) {
|
||||||
groupViews[k]->widget.hide();
|
groupViews[k]->widget.hide();
|
||||||
}
|
}
|
||||||
@@ -728,6 +732,7 @@ QMainWindow *initTrainWindow() {
|
|||||||
{ // Top button menu.
|
{ // Top button menu.
|
||||||
auto hTopButtons = new QHBoxLayout();
|
auto hTopButtons = new QHBoxLayout();
|
||||||
auto topButtons = new QWidget();
|
auto topButtons = new QWidget();
|
||||||
|
topButtons->setStyleSheet(buttonStyle);
|
||||||
topButtons->setLayout(hTopButtons);
|
topButtons->setLayout(hTopButtons);
|
||||||
|
|
||||||
auto topLeftSpacer = new QSpacerItem(50, 50, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
auto topLeftSpacer = new QSpacerItem(50, 50, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
@@ -748,9 +753,11 @@ QMainWindow *initTrainWindow() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{ // Make the question box.
|
{ // Make the question box.
|
||||||
questionBox = new QWidget();
|
questionBox = new QWidget();
|
||||||
|
questionBox->setStyleSheet(
|
||||||
|
"font-size: 15px;"
|
||||||
|
);
|
||||||
vQuestionBox = new QVBoxLayout();
|
vQuestionBox = new QVBoxLayout();
|
||||||
questionBox->setLayout(vQuestionBox);
|
questionBox->setLayout(vQuestionBox);
|
||||||
questionBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
questionBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||||
@@ -785,7 +792,7 @@ QMainWindow *initTrainWindow() {
|
|||||||
answerText->setWordWrap(true);
|
answerText->setWordWrap(true);
|
||||||
answerText->setStyleSheet(QString(
|
answerText->setStyleSheet(QString(
|
||||||
"QLabel {"
|
"QLabel {"
|
||||||
"font-size: 15px;"
|
"font-size: 17px;"
|
||||||
"}"
|
"}"
|
||||||
));
|
));
|
||||||
answerText->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
answerText->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||||
@@ -820,8 +827,12 @@ QMainWindow *initTrainWindow() {
|
|||||||
vButtonBox = new QVBoxLayout();
|
vButtonBox = new QVBoxLayout();
|
||||||
actionButtons = new QWidget();
|
actionButtons = new QWidget();
|
||||||
hButtons = new QHBoxLayout();
|
hButtons = new QHBoxLayout();
|
||||||
|
leftSpacer = new QSpacerItem(
|
||||||
leftSpacer = new QSpacerItem(50, 50, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
50,
|
||||||
|
50,
|
||||||
|
QSizePolicy::Expanding,
|
||||||
|
QSizePolicy::Minimum
|
||||||
|
);
|
||||||
|
|
||||||
btnCheck = new QToolButton();
|
btnCheck = new QToolButton();
|
||||||
btnNotRemembered = new QToolButton();
|
btnNotRemembered = new QToolButton();
|
||||||
@@ -923,12 +934,7 @@ QMainWindow *initTrainWindow() {
|
|||||||
setupNextQuestion();
|
setupNextQuestion();
|
||||||
});
|
});
|
||||||
questionBox->setObjectName("question-box");
|
questionBox->setObjectName("question-box");
|
||||||
actionButtons->setStyleSheet(QString(
|
actionButtons->setStyleSheet(buttonStyle);
|
||||||
"QToolButton {"
|
|
||||||
"padding: 4px 5px;"
|
|
||||||
"font-size: 15px;"
|
|
||||||
"}"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // Make group question view.
|
{ // Make group question view.
|
||||||
|
|||||||
Reference in New Issue
Block a user