-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Add an option to set cursor blinking speed in miliseconds #4758
Merged
ccordoba12
merged 12 commits into
spyder-ide:3.x
from
jnsebgosselin:caret_blinking_option
Aug 26, 2017
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5e29849
Added an option to set caret cursor blinking speed in ms
jnsebgosselin 529c4a6
Aligned custom margins and caret blinking spinboxes and slabels
jnsebgosselin 1e86648
Added an option to set caret cursor blinking speed in ms
jnsebgosselin af827f2
Aligned custom margins and caret blinking spinboxes and slabels
jnsebgosselin 4d61e09
Removed line added by mistake when resolving conflicts
jnsebgosselin d88b57a
Merge remote-tracking branch 'origin/caret_blinking_option' into care…
jnsebgosselin 46f5a70
Replaced all "caret" words by "cursor"
jnsebgosselin 145fed0
Cache cursor flash time value on startup
jnsebgosselin 0a8b97a
removed not needed `is True`
jnsebgosselin 08829f0
Changed how default value is set for cursor blink speed spinbox
jnsebgosselin 4f112ab
Removed a print statement that was not deleted before push...
jnsebgosselin 76e3691
removed spaces around = for keyword args and changed step of spinbox
jnsebgosselin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ | |
QLineEdit, QListView, QListWidget, QListWidgetItem, | ||
QMessageBox, QPushButton, QRadioButton, | ||
QScrollArea, QSpinBox, QSplitter, QStackedWidget, | ||
QStyleFactory, QTabWidget, QVBoxLayout, QWidget) | ||
QStyleFactory, QTabWidget, QVBoxLayout, QWidget, | ||
QApplication) | ||
|
||
# Local imports | ||
from spyder.config.base import (_, LANGUAGE_CODES, load_lang_conf, | ||
|
@@ -328,6 +329,7 @@ def load_from_conf(self): | |
if lineedit.restart_required: | ||
self.restart_options[option] = lineedit.label_text | ||
for spinbox, (option, default) in list(self.spinboxes.items()): | ||
print(option, default, self.get_option(option, default)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this |
||
spinbox.setValue(self.get_option(option, default)) | ||
spinbox.valueChanged.connect(lambda _foo, opt=option: | ||
self.has_been_modified(opt)) | ||
|
@@ -887,7 +889,8 @@ def setup_page(self): | |
cursor_box = newcb(_("Cursor blinking:"), | ||
'use_custom_cursor_blinking') | ||
cursor_spin = self.create_spinbox("", _("ms"), 'custom_cursor_blinking', | ||
0, 0, 5000) | ||
default = QApplication.cursorFlashTime(), | ||
min_ = 0, max_ = 5000, step = 10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove spaces around |
||
cursor_box.toggled.connect(cursor_spin.spinbox.setEnabled) | ||
cursor_box.toggled.connect(cursor_spin.slabel.setEnabled) | ||
cursor_spin.spinbox.setEnabled( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccordoba12 and @jnsebgosselin I think we still need to have the option here, the only difference is that it would be
None
by default, and when building the spinbox, we would check if it is None and update with the default by QApplication, or just use the stored value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do that, then delete my .init files and restart Spyder, I get the following traceback:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@goanpeca, there is no need to do that because values are placed here only if we plan to change/update them in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this value is OS dependent, so we can't put it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok