Gui: Add option to enable/disable text cursor blinking

This commit is contained in:
marioalexis
2022-01-26 23:24:38 -03:00
committed by wwmayer
parent 8da66398ad
commit 19668d2924
3 changed files with 30 additions and 1 deletions

View File

@@ -2099,6 +2099,10 @@ void Application::runApplication(void)
mainApp.installEventFilter(filter);
}
// set text cursor blinking state
int blinkTime = hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0;
qApp->setCursorFlashTime(blinkTime);
{
QWindow window;
window.setSurfaceType(QWindow::OpenGLSurface);

View File

@@ -342,7 +342,7 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item row="0" column="0">
<widget class="QCheckBox" name="tiledBackground">
<property name="toolTip">
<string>Background of the main window will consist of tiles of a special image.
@@ -353,6 +353,25 @@ See the FreeCAD Wiki for details about the image.</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefCheckBox" name="EnableCursorBlinking">
<property name="toolTip">
<string>The text cursor will be blinking</string>
</property>
<property name="text">
<string>Enable cursor blinking</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>EnableCursorBlinking</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>General</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
@@ -625,6 +644,7 @@ horizontal space in Python console</string>
<tabstops>
<tabstop>Languages</tabstop>
<tabstop>RecentFiles</tabstop>
<tabstop>EnableCursorBlinking</tabstop>
<tabstop>SplashScreen</tabstop>
<tabstop>PythonWordWrap</tabstop>
<tabstop>PythonBlockCursor</tabstop>

View File

@@ -142,6 +142,7 @@ void DlgGeneralImp::saveSettings()
ui->SubstituteDecimal->onSave();
ui->RecentFiles->onSave();
ui->EnableCursorBlinking->onSave();
ui->SplashScreen->onSave();
ui->PythonWordWrap->onSave();
ui->PythonBlockCursor->onSave();
@@ -174,6 +175,9 @@ void DlgGeneralImp::saveSettings()
hGrp->SetInt("ToolbarIconSize", pixel);
getMainWindow()->setIconSize(QSize(pixel,pixel));
int blinkTime = hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0;
qApp->setCursorFlashTime(blinkTime);
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/DockWindows");
bool treeView=false, propertyView=false, comboView=true;
switch(ui->treeMode->currentIndex()) {
@@ -208,6 +212,7 @@ void DlgGeneralImp::loadSettings()
ui->SubstituteDecimal->onRestore();
ui->RecentFiles->onRestore();
ui->EnableCursorBlinking->onRestore();
ui->SplashScreen->onRestore();
ui->PythonWordWrap->onRestore();
ui->PythonBlockCursor->onRestore();