Skip to content

Commit

Permalink
adding configurability of blinking of cursor (#2298)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuspen committed Jul 2, 2023
1 parent da855f9 commit 26db493
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ct/ct_actions_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ void CtActions::preferences_import()
_pCtConfig->showLineNumbers = ctConfigImported.showLineNumbers;
_pCtConfig->scrollBeyondLastLine = ctConfigImported.scrollBeyondLastLine;
_pCtConfig->spacesInsteadTabs = ctConfigImported.spacesInsteadTabs;
_pCtConfig->cursorBlink = ctConfigImported.cursorBlink;
_pCtConfig->tabsWidth = ctConfigImported.tabsWidth;
_pCtConfig->anchorSize = ctConfigImported.anchorSize;
_pCtConfig->latexSizeDpi = ctConfigImported.latexSizeDpi;
Expand Down
2 changes: 2 additions & 0 deletions src/ct/ct_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ void CtConfig::_populate_keyfile_from_data()
_uKeyFile->set_boolean(_currentGroup, "show_line_numbers", showLineNumbers);
_uKeyFile->set_boolean(_currentGroup, "scroll_beyond_last_line", scrollBeyondLastLine);
_uKeyFile->set_boolean(_currentGroup, "spaces_instead_tabs", spacesInsteadTabs);
_uKeyFile->set_integer(_currentGroup, "cursor_blink", cursorBlink);
_uKeyFile->set_integer(_currentGroup, "tabs_width", tabsWidth);
_uKeyFile->set_integer(_currentGroup, "anchor_size", anchorSize);
_uKeyFile->set_integer(_currentGroup, "latex_size_dpi", latexSizeDpi);
Expand Down Expand Up @@ -545,6 +546,7 @@ void CtConfig::_populate_data_from_keyfile()
_populate_bool_from_keyfile("show_line_numbers", &showLineNumbers);
_populate_bool_from_keyfile("scroll_beyond_last_line", &scrollBeyondLastLine);
_populate_bool_from_keyfile("spaces_instead_tabs", &spacesInsteadTabs);
_populate_int_from_keyfile("cursor_blink", &cursorBlink);
_populate_int_from_keyfile("tabs_width", &tabsWidth);
_populate_int_from_keyfile("anchor_size", &anchorSize);
_populate_int_from_keyfile("latex_size_dpi", &latexSizeDpi);
Expand Down
1 change: 1 addition & 0 deletions src/ct/ct_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class CtConfig
bool showLineNumbers{false};
bool scrollBeyondLastLine{true};
bool spacesInsteadTabs{false};
int cursorBlink{2};
int tabsWidth{4};
int anchorSize{16};
int latexSizeDpi{140};
Expand Down
3 changes: 3 additions & 0 deletions src/ct/ct_main_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ void CtMainWin::config_apply()
_ctTextview.set_pixels_inside_wrap(_pCtConfig->spaceAroundLines, _pCtConfig->relativeWrappedSpace);
_ctTextview.set_wrap_mode(_pCtConfig->lineWrapping ? Gtk::WrapMode::WRAP_WORD_CHAR : Gtk::WrapMode::WRAP_NONE);

if (2 != _pCtConfig->cursorBlink) {
Gtk::Settings::get_default()->property_gtk_cursor_blink() = _pCtConfig->cursorBlink;
}
update_theme();
}

Expand Down

0 comments on commit 26db493

Please sign in to comment.