Add option to disable cursor blinking
This commit is contained in:
parent
151aa07af3
commit
eda024688a
@ -205,6 +205,7 @@ int main(int argc, char **argv) {
|
|||||||
settings->loadPreferences();
|
settings->loadPreferences();
|
||||||
|
|
||||||
if(!parser->value(wOption).isEmpty()) settings->loadWorkspace(parser->value(wOption).toLocal8Bit().data());
|
if(!parser->value(wOption).isEmpty()) settings->loadWorkspace(parser->value(wOption).toLocal8Bit().data());
|
||||||
|
if(settings->disable_cursor_blinking) app.setCursorFlashTime(0);
|
||||||
|
|
||||||
CALCULATOR->loadExchangeRates();
|
CALCULATOR->loadExchangeRates();
|
||||||
|
|
||||||
@ -261,6 +262,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
win->setCommandLineParser(parser);
|
win->setCommandLineParser(parser);
|
||||||
win->show();
|
win->show();
|
||||||
|
|
||||||
app.processEvents();
|
app.processEvents();
|
||||||
win->initFinished();
|
win->initFinished();
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include <QFontDialog>
|
#include <QFontDialog>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QApplication>
|
||||||
#if defined _WIN32 && (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
#if defined _WIN32 && (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||||
# include <QApplication>
|
|
||||||
# include <QStyleHints>
|
# include <QStyleHints>
|
||||||
#endif
|
#endif
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -165,6 +165,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent) {
|
|||||||
#else
|
#else
|
||||||
BOX(tr("Dark mode"), settings->palette == 1, darkModeToggled(bool));
|
BOX(tr("Dark mode"), settings->palette == 1, darkModeToggled(bool));
|
||||||
#endif
|
#endif
|
||||||
|
BOX(tr("Disable cursor blinking"), settings->disable_cursor_blinking, disableCursorBlinkingToggled(bool));
|
||||||
BOX(tr("Colorize result"), settings->colorize_result, colorizeToggled(bool));
|
BOX(tr("Colorize result"), settings->colorize_result, colorizeToggled(bool));
|
||||||
BOX(tr("Format result"), settings->format_result, formatToggled(bool));
|
BOX(tr("Format result"), settings->format_result, formatToggled(bool));
|
||||||
BOX1(tr("Custom result font:"), settings->use_custom_result_font, resultFontToggled(bool));
|
BOX1(tr("Custom result font:"), settings->use_custom_result_font, resultFontToggled(bool));
|
||||||
@ -693,6 +694,11 @@ void PreferencesDialog::automaticDigitGroupingToggled(bool b) {
|
|||||||
void PreferencesDialog::closeWithEscToggled(bool b) {
|
void PreferencesDialog::closeWithEscToggled(bool b) {
|
||||||
settings->close_with_esc = b;
|
settings->close_with_esc = b;
|
||||||
}
|
}
|
||||||
|
void PreferencesDialog::disableCursorBlinkingToggled(bool b) {
|
||||||
|
settings->disable_cursor_blinking = b;
|
||||||
|
if(b) qApp->setCursorFlashTime(0);
|
||||||
|
else qApp->setCursorFlashTime(1000);
|
||||||
|
}
|
||||||
void PreferencesDialog::mixedUnitsToggled(bool b) {
|
void PreferencesDialog::mixedUnitsToggled(bool b) {
|
||||||
if(b) settings->evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_DEFAULT;
|
if(b) settings->evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_DEFAULT;
|
||||||
else settings->evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_NONE;
|
else settings->evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_NONE;
|
||||||
|
@ -109,6 +109,7 @@ class PreferencesDialog : public QDialog {
|
|||||||
void caretAsXorToggled(bool);
|
void caretAsXorToggled(bool);
|
||||||
void automaticDigitGroupingToggled(bool);
|
void automaticDigitGroupingToggled(bool);
|
||||||
void closeWithEscToggled(bool);
|
void closeWithEscToggled(bool);
|
||||||
|
void disableCursorBlinkingToggled(bool);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -702,6 +702,8 @@ void QalculateQtSettings::readPreferenceValue(const std::string &svar, const std
|
|||||||
#else
|
#else
|
||||||
palette = v;
|
palette = v;
|
||||||
#endif
|
#endif
|
||||||
|
} else if(svar == "disable_cursor_blinking") {
|
||||||
|
disable_cursor_blinking = v;
|
||||||
} else if(svar == "color") {
|
} else if(svar == "color") {
|
||||||
colorize_result = v;
|
colorize_result = v;
|
||||||
} else if(svar == "format") {
|
} else if(svar == "format") {
|
||||||
@ -1030,6 +1032,7 @@ void QalculateQtSettings::loadPreferences() {
|
|||||||
custom_app_font = "";
|
custom_app_font = "";
|
||||||
style = "";
|
style = "";
|
||||||
palette = -1;
|
palette = -1;
|
||||||
|
disable_cursor_blinking = false;
|
||||||
replace_expression = KEEP_EXPRESSION;
|
replace_expression = KEEP_EXPRESSION;
|
||||||
autocopy_result = false;
|
autocopy_result = false;
|
||||||
save_mode_on_exit = true;
|
save_mode_on_exit = true;
|
||||||
@ -1470,6 +1473,7 @@ bool QalculateQtSettings::savePreferences(const char *filename, bool is_workspac
|
|||||||
fprintf(file, "separate_keypad_menu_buttons=%i\n", separate_keypad_menu_buttons);
|
fprintf(file, "separate_keypad_menu_buttons=%i\n", separate_keypad_menu_buttons);
|
||||||
fprintf(file, "palette=%i\n", palette);
|
fprintf(file, "palette=%i\n", palette);
|
||||||
fprintf(file, "color=%i\n", colorize_result);
|
fprintf(file, "color=%i\n", colorize_result);
|
||||||
|
if(disable_cursor_blinking) fprintf(file, "disable_cursor_blinking=%i\n", disable_cursor_blinking);
|
||||||
if(!format_result) fprintf(file, "format=%i\n", format_result);
|
if(!format_result) fprintf(file, "format=%i\n", format_result);
|
||||||
fprintf(file, "use_custom_result_font=%i\n", use_custom_result_font);
|
fprintf(file, "use_custom_result_font=%i\n", use_custom_result_font);
|
||||||
fprintf(file, "use_custom_expression_font=%i\n", use_custom_expression_font);
|
fprintf(file, "use_custom_expression_font=%i\n", use_custom_expression_font);
|
||||||
|
@ -281,6 +281,7 @@ class QalculateQtSettings : QObject {
|
|||||||
QByteArray units_geometry, units_vsplitter_state, units_hsplitter_state;
|
QByteArray units_geometry, units_vsplitter_state, units_hsplitter_state;
|
||||||
QByteArray variables_geometry, variables_vsplitter_state, variables_hsplitter_state;
|
QByteArray variables_geometry, variables_vsplitter_state, variables_hsplitter_state;
|
||||||
QByteArray datasets_geometry, datasets_vsplitter_state, datasets_hsplitter_state;
|
QByteArray datasets_geometry, datasets_vsplitter_state, datasets_hsplitter_state;
|
||||||
|
bool disable_cursor_blinking;
|
||||||
bool wayland_platform;
|
bool wayland_platform;
|
||||||
|
|
||||||
int preserve_history_height;
|
int preserve_history_height;
|
||||||
|
Loading…
Reference in New Issue
Block a user