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);
|
||||
|
||||
Reference in New Issue
Block a user