Small fixes
This commit is contained in:
@@ -187,21 +187,22 @@ class AnnotationsUI(QtWidgets.QDialog, annotationswindow.Ui_Dialog):
|
|||||||
self.update_preview()
|
self.update_preview()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
new_color = None
|
||||||
|
|
||||||
if sender == self.foregroundColorButton:
|
if sender == self.foregroundColorButton:
|
||||||
new_color = self.get_color(self.foregroundColor)
|
new_color = self.get_color(self.foregroundColor)
|
||||||
self.set_button_background_color(self.foregroundColorButton, new_color)
|
|
||||||
self.foregroundColor = new_color
|
self.foregroundColor = new_color
|
||||||
|
|
||||||
if sender == self.highlightColorButton:
|
if sender == self.highlightColorButton:
|
||||||
new_color = self.get_color(self.highlightColor)
|
new_color = self.get_color(self.highlightColor)
|
||||||
self.set_button_background_color(self.highlightColorButton, new_color)
|
|
||||||
self.highlightColor = new_color
|
self.highlightColor = new_color
|
||||||
|
|
||||||
if sender == self.underlineColorButton:
|
if sender == self.underlineColorButton:
|
||||||
new_color = self.get_color(self.underlineColor)
|
new_color = self.get_color(self.underlineColor)
|
||||||
self.set_button_background_color(self.underlineColorButton, new_color)
|
|
||||||
self.underlineColor = new_color
|
self.underlineColor = new_color
|
||||||
|
|
||||||
|
if new_color:
|
||||||
|
self.set_button_background_color(sender, new_color)
|
||||||
self.update_preview()
|
self.update_preview()
|
||||||
|
|
||||||
def get_color(self, current_color):
|
def get_color(self, current_color):
|
||||||
|
@@ -327,6 +327,7 @@ class PliantQTextBrowser(QtWidgets.QTextBrowser):
|
|||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.main_window = main_window
|
self.main_window = main_window
|
||||||
|
|
||||||
|
self.annotation_mode = False
|
||||||
self.annotator = AnnotationPlacement()
|
self.annotator = AnnotationPlacement()
|
||||||
self.current_annotation = None
|
self.current_annotation = None
|
||||||
|
|
||||||
@@ -512,6 +513,9 @@ class PliantQTextBrowser(QtWidgets.QTextBrowser):
|
|||||||
self.main_window.closeEvent()
|
self.main_window.closeEvent()
|
||||||
|
|
||||||
def mouseMoveEvent(self, event):
|
def mouseMoveEvent(self, event):
|
||||||
|
if self.annotation_mode:
|
||||||
|
self.viewport().setCursor(QtCore.Qt.IBeamCursor)
|
||||||
|
else:
|
||||||
self.viewport().setCursor(QtCore.Qt.ArrowCursor)
|
self.viewport().setCursor(QtCore.Qt.ArrowCursor)
|
||||||
self.parent.mouse_hide_timer.start(3000)
|
self.parent.mouse_hide_timer.start(3000)
|
||||||
QtWidgets.QTextBrowser.mouseMoveEvent(self, event)
|
QtWidgets.QTextBrowser.mouseMoveEvent(self, event)
|
||||||
|
8
lector/resources/raw/DarkIcons/annotate.svg
Normal file
8
lector/resources/raw/DarkIcons/annotate.svg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||||
|
<defs>
|
||||||
|
<style id="current-color-scheme" type="text/css">
|
||||||
|
.ColorScheme-Text { color:#5c616c; } .ColorScheme-Highlight { color:#5294e2; }
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<path style="fill:currentColor" class="ColorScheme-Text" d="m12.213 1c-0.213 0-0.425 0.083-0.59 0.248l-1.6308 1.6387 3.1208 3.1211 1.639-1.6308c0.33-0.33 0.33-0.8497 0-1.1797l-1.949-1.9493c-0.165-0.165-0.378-0.248-0.59-0.248zm-3.34 3.0078l-7.8808 7.8792-0.00001 3.121h3.1211l0.0078-0.008h10.879v-2h-8.8789l5.8709-5.873-3.119-3.1192z" transform="translate(4 4)"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 617 B |
8
lector/resources/raw/LightIcons/annotate.svg
Normal file
8
lector/resources/raw/LightIcons/annotate.svg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||||
|
<defs>
|
||||||
|
<style id="current-color-scheme" type="text/css">
|
||||||
|
.ColorScheme-Text { color:#d3dae3; } .ColorScheme-Highlight { color:#5294e2; }
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<path style="fill:currentColor" class="ColorScheme-Text" d="m12.213 1c-0.213 0-0.425 0.083-0.59 0.248l-1.6308 1.6387 3.1208 3.1211 1.639-1.6308c0.33-0.33 0.33-0.8497 0-1.1797l-1.949-1.9493c-0.165-0.165-0.378-0.248-0.59-0.248zm-3.34 3.0078l-7.8808 7.8792-0.00001 3.121h3.1211l0.0078-0.008h10.879v-2h-8.8789l5.8709-5.873-3.119-3.1192z" transform="translate(4 4)"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 617 B |
@@ -120,7 +120,9 @@ class Tab(QtWidgets.QWidget):
|
|||||||
self.annotationListView = QtWidgets.QListView(self.annotationDock)
|
self.annotationListView = QtWidgets.QListView(self.annotationDock)
|
||||||
self.annotationListView.setResizeMode(QtWidgets.QListWidget.Adjust)
|
self.annotationListView.setResizeMode(QtWidgets.QListWidget.Adjust)
|
||||||
self.annotationListView.setMaximumWidth(350)
|
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.annotationListView.setEditTriggers(QtWidgets.QListView.NoEditTriggers)
|
||||||
self.annotationDock.setWidget(self.annotationListView)
|
self.annotationDock.setWidget(self.annotationListView)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user