diff --git a/lector/annotations.py b/lector/annotations.py index 3c2b9a7..172d54b 100644 --- a/lector/annotations.py +++ b/lector/annotations.py @@ -187,21 +187,22 @@ class AnnotationsUI(QtWidgets.QDialog, annotationswindow.Ui_Dialog): self.update_preview() return + new_color = None + if sender == self.foregroundColorButton: new_color = self.get_color(self.foregroundColor) - self.set_button_background_color(self.foregroundColorButton, new_color) self.foregroundColor = new_color if sender == self.highlightColorButton: new_color = self.get_color(self.highlightColor) - self.set_button_background_color(self.highlightColorButton, new_color) self.highlightColor = new_color if sender == self.underlineColorButton: new_color = self.get_color(self.underlineColor) - self.set_button_background_color(self.underlineColorButton, new_color) self.underlineColor = new_color + if new_color: + self.set_button_background_color(sender, new_color) self.update_preview() def get_color(self, current_color): diff --git a/lector/contentwidgets.py b/lector/contentwidgets.py index 7a7db6f..8d712c1 100644 --- a/lector/contentwidgets.py +++ b/lector/contentwidgets.py @@ -327,6 +327,7 @@ class PliantQTextBrowser(QtWidgets.QTextBrowser): self.parent = parent self.main_window = main_window + self.annotation_mode = False self.annotator = AnnotationPlacement() self.current_annotation = None @@ -512,7 +513,10 @@ class PliantQTextBrowser(QtWidgets.QTextBrowser): self.main_window.closeEvent() def mouseMoveEvent(self, event): - self.viewport().setCursor(QtCore.Qt.ArrowCursor) + if self.annotation_mode: + self.viewport().setCursor(QtCore.Qt.IBeamCursor) + else: + self.viewport().setCursor(QtCore.Qt.ArrowCursor) self.parent.mouse_hide_timer.start(3000) QtWidgets.QTextBrowser.mouseMoveEvent(self, event) diff --git a/lector/resources/raw/DarkIcons/annotate.svg b/lector/resources/raw/DarkIcons/annotate.svg new file mode 100644 index 0000000..cd020c1 --- /dev/null +++ b/lector/resources/raw/DarkIcons/annotate.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/lector/resources/raw/LightIcons/annotate.svg b/lector/resources/raw/LightIcons/annotate.svg new file mode 100644 index 0000000..7389d23 --- /dev/null +++ b/lector/resources/raw/LightIcons/annotate.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/lector/widgets.py b/lector/widgets.py index 5ec2786..0b2cc63 100644 --- a/lector/widgets.py +++ b/lector/widgets.py @@ -120,7 +120,9 @@ class Tab(QtWidgets.QWidget): self.annotationListView = QtWidgets.QListView(self.annotationDock) self.annotationListView.setResizeMode(QtWidgets.QListWidget.Adjust) self.annotationListView.setMaximumWidth(350) - self.annotationListView.doubleClicked.connect(self.contentView.toggle_annotation_mode) + if not self.are_we_doing_images_only: + self.annotationListView.doubleClicked.connect( + self.contentView.toggle_annotation_mode) self.annotationListView.setEditTriggers(QtWidgets.QListView.NoEditTriggers) self.annotationDock.setWidget(self.annotationListView)