- attempt to allow change the text font size

This commit is contained in:
Dmytro Bogovych 2021-04-05 07:46:21 +03:00
parent e1791d755f
commit b45ed3067a
4 changed files with 76 additions and 2 deletions

View File

@ -1,2 +1,2 @@
// Auto generated file ! Please do not edit ! // Auto generated file ! Please do not edit !
#define APP_BUILD_NUMBER 170 #define APP_BUILD_NUMBER 177

View File

@ -264,6 +264,9 @@ void MainWindow::initClient()
mTimeFrameHeight = 64;//ui->mTimeFrame->height(); mTimeFrameHeight = 64;//ui->mTimeFrame->height();
ui->mStartRecentTaskMenu->setEnabled(false); ui->mStartRecentTaskMenu->setEnabled(false);
// connect(ui->mIncreaseLevelAction, SIGNAL(triggered()), this, SLOT(onIncreaseFontSize()));
// connect(ui->mDecreaseLevelAction, SIGNAL(triggered()), this, SLOT(onDecreaseFontSize()));
buildOpenOrCreateView(); buildOpenOrCreateView();
buildPasswordView(); buildPasswordView();
} }
@ -1724,3 +1727,15 @@ void MainWindow::showFatal(const QString& message)
std::cerr << message.toStdString() << std::endl; std::cerr << message.toStdString() << std::endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
void MainWindow::onIncreaseFontSize()
{
QFont f = QApplication::font("QWidget");
f.setPixelSize(f.pixelSize() + 1);
QApplication::setFont(f, "QWidget");
}
void MainWindow::onDecreaseFontSize()
{
}

View File

@ -235,6 +235,9 @@ public slots:
void onDbPasswordCancelled(); void onDbPasswordCancelled();
void onNewDbPasswordEntered(const QString& password); void onNewDbPasswordEntered(const QString& password);
void onDatabaseChanged(const QString& path); void onDatabaseChanged(const QString& path);
void onIncreaseFontSize();
void onDecreaseFontSize();
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1206</width> <width>1206</width>
<height>522</height> <height>630</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -734,6 +734,28 @@
<string>Ctrl+Shift+Down</string> <string>Ctrl+Shift+Down</string>
</property> </property>
</action> </action>
<action name="mIncreaseFontSizeAction">
<property name="text">
<string>Increase font size</string>
</property>
<property name="toolTip">
<string>Increase font size</string>
</property>
<property name="shortcut">
<string>Ctrl+=</string>
</property>
</action>
<action name="mDecreaseFontSize">
<property name="text">
<string>Decrease font size</string>
</property>
<property name="toolTip">
<string>Decrease font size</string>
</property>
<property name="shortcut">
<string>Ctrl+-</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>
@ -1296,6 +1318,38 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>mIncreaseFontSizeAction</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>onIncreaseFontSize()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>602</x>
<y>314</y>
</hint>
</hints>
</connection>
<connection>
<sender>mDecreaseFontSize</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>onDecreaseFontSize()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>602</x>
<y>314</y>
</hint>
</hints>
</connection>
</connections> </connections>
<slots> <slots>
<slot>save()</slot> <slot>save()</slot>
@ -1334,5 +1388,7 @@
<slot>newSibling()</slot> <slot>newSibling()</slot>
<slot>moveUp()</slot> <slot>moveUp()</slot>
<slot>moveDown()</slot> <slot>moveDown()</slot>
<slot>onIncreaseFontSize()</slot>
<slot>onDecreaseFontSize()</slot>
</slots> </slots>
</ui> </ui>