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