Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 85d6e05
Merge: 66127d0 3eddeb6
Author: glubsy <[email protected]>
Date:   Wed Jul 15 21:25:44 2020 +0200

    Merge branch 'dockable_windows' into details_dialog_improvements_dev

commit 66127d0
Author: glubsy <[email protected]>
Date:   Wed Jul 15 20:22:13 2020 +0200

    Add credit for icons used, upscale exchange icon

    * Jason Cho gave his express permission to use the icon (it was made 10 years ago and he doesn't have the source files anymore)
    * Used waifu2x to upscale the icon
    * Used GIMP to draw dark outline around the icon
    * Source files are included

commit 58c675d
Author: glubsy <[email protected]>
Date:   Wed Jul 15 05:25:47 2020 +0200

    Add custom icons

    * Use custom icons on platforms which do not provide theme
    * Old zoom icons credits to "schollidesign" from icon pack Office and Entertainment (GPL licence).
    * Exchange icon credit to Jason Cho (Unknown license).
    * Use hack to resize viewers on first show() as well

commit 95b8406
Author: glubsy <[email protected]>
Date:   Wed Jul 15 04:14:24 2020 +0200

    Fix scrollbar displayed while splitter maxed out

    * For some reason the table's height is a few pixel longer on Windows so we work around the issue by adding a small offset to the maximum height hint.
    * No idea about MacOS yet but this might need the same treatment.

commit 3eddeb6
Author: glubsy <[email protected]>
Date:   Tue Jul 14 17:37:48 2020 +0200

    Fix ME/SE details dialogs, add preferences

    * Fix ME and SE versions of details dialog not displaying their content properly after change to QDockWidget
    * Add option to toggle titlebar and orientation of titlebar in preferences dialog
    * Fix setting layout on PE details dialog window while layout already set, by removing the self (parent) reference in constructing the QSplitter

commit 56912a7
Author: glubsy <[email protected]>
Date:   Mon Jul 13 05:06:04 2020 +0200

    Make details dialog dockable

commit 7ab2998
Merge: e7b3252 b0a256f
Author: glubsy <[email protected]>
Date:   Sun Jul 12 17:54:51 2020 +0200

    Merge commit 'b0a256f0'

commit e7b3252
Author: glubsy <[email protected]>
Date:   Mon Jun 29 22:31:43 2020 +0200

    Cleanup of details table

commit 36ab844
Author: glubsy <[email protected]>
Date:   Sun Jun 28 19:51:57 2020 +0200

    Move buttons into the toolbar class.

    * Moved the QToolbar into the image viewer's  translation unit.
    * QAction are still attached to the dialog window for shortcuts to work

commit 370b582
Author: glubsy <[email protected]>
Date:   Sun Jun 28 03:31:03 2020 +0200

    Add working zoom functions to GraphicsView viewers.

commit 9f15139
Author: glubsy <[email protected]>
Date:   Wed Jun 24 17:12:59 2020 +0200

    Fix view resetting when selecting reference only.

    * Needed to ignore the scrollbar changes in the disabled
    panel, sine a null pixmap would reset the bars to 0 and affect
    the selected viewer.
    * Keep view as same scale accross entries from the same group.

commit 011939f
Author: glubsy <[email protected]>
Date:   Tue Jun 23 05:03:56 2020 +0200

    Keep scale accross files of the same dupe group.

    * Also fix scaled down pixmap when updating pixmap in the same group
    * Fix ignoring mouse wheel event when max scale has been reached
    * Fix toggle scrollbars when asking for normal size

commit 977c20f
Author: glubsy <[email protected]>
Date:   Mon Jun 22 03:36:36 2020 +0200

    Add QSplitter to hide TableView in DetailsDialog

commit aa79b31
Author: glubsy <[email protected]>
Date:   Sun Jun 21 20:51:06 2020 +0200

    Work around resizing down offset by 1 pixel.

commit 970bb5e
Author: glubsy <[email protected]>
Date:   Sun Jun 21 01:49:17 2020 +0200

    Add mostly working ScrollArea imge viewers

    * Work around flickering of scrollbars due to
    GridLayout resizing on odd pixels by disabling
    the scrollbars while BestFit is active
    * Also setting minimum column width to work around
    the issue above.
    * Avoid updating scrollbar values twice by using a
    simple boolean lock

commit a706d0e
Author: glubsy <[email protected]>
Date:   Tue Jun 16 21:14:28 2020 +0200

    Implement mostly working ScrollArea viewer

    Using a QWidget inside the QScrollArea mostly works
    but we only move around the pixmap inside the QWidget,
    not the QWidget itself, which doesn't update scrollbars.
    Need a better implementation.

commit b7abcf2
Author: glubsy <[email protected]>
Date:   Wed Jun 10 22:02:08 2020 +0200

    Use native QPixmap swap() method instead of manual setPixmap()

    When swapping images, use getters to hopefully get a reference to
    each pixmap and swap them within a single slot.

commit 8103cb3
Author: glubsy <[email protected]>
Date:   Wed Jun 10 18:23:48 2020 +0200

    Disable unused methods from controller

    * setPixmap() now disables the QWidget automatically if the pixmap passed is null.
    * the controller relays repaint events to the other widget

commit c379791
Author: glubsy <[email protected]>
Date:   Wed Jun 10 01:24:51 2020 +0200

    Controller class to decouple from the dialog class

    The controller singleton acts as a proxy to relay
    signals from each widget to the other
    It should help encapsulating things better if we need to
    use a different class for image viewers in the future.

commit 60ddb9b
Author: glubsy <[email protected]>
Date:   Fri Jun 5 22:39:16 2020 +0200

    Working synchronized views.

commit a29f3fb
Author: glubsy <[email protected]>
Date:   Thu Jun 4 17:52:46 2020 +0200

    only update delta when mouse is being dragged to reduce paint events

commit c616291
Author: glubsy <[email protected]>
Date:   Thu Jun 4 17:38:28 2020 +0200

    working synchronized panning

commit 02bd822
Author: glubsy <[email protected]>
Date:   Thu Jun 4 02:33:54 2020 +0200

    working zoom functions, mouse wheel event

commit ea61976
Author: glubsy <[email protected]>
Date:   Sat May 2 18:05:19 2020 +0200

    drag mouse with ImageViewer class

commit 468a736
Author: glubsy <[email protected]>
Date:   Sat May 2 15:09:01 2020 +0200

    add normal size button

commit f42df12
Author: glubsy <[email protected]>
Date:   Sat May 2 02:29:23 2020 +0200

    attempt at double click on Qlabel

commit 9b48e18
Author: glubsy <[email protected]>
Date:   Fri May 1 18:22:25 2020 +0200

    add zoom and swap buttons to details dialog
  • Loading branch information
glubsy committed Jul 15, 2020
1 parent b0a256f commit 8827209
Show file tree
Hide file tree
Showing 23 changed files with 125 additions and 35 deletions.
Binary file added images/exchange.icns
Binary file not shown.
Binary file added images/exchange.ico
Binary file not shown.
Binary file added images/exchange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/exchange_purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/exchange_purple_upscaled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/exchange_purple_waifu_s4_tta8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/exchange_purple_waifu_s4_tta8.xcf
Binary file not shown.
Binary file added images/exchange_waifu_s4_tta8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/old_zoom_best_fit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/old_zoom_in.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/old_zoom_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/old_zoom_out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
import os.path as op

from PyQt5.QtCore import QTimer, QObject, QUrl, pyqtSignal
from PyQt5.QtCore import QTimer, QObject, QUrl, pyqtSignal, Qt
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtWidgets import QApplication, QFileDialog, QDialog, QMessageBox

Expand Down Expand Up @@ -54,11 +54,11 @@ def __init__(self, **kwargs):
def _setup(self):
core.pe.photo.PLAT_SPECIFIC_PHOTO_CLASS = PlatSpecificPhoto
self._setupActions()
self.details_dialog = None
self._update_options()
self.recentResults = Recent(self, "recentResults")
self.recentResults.mustOpenItem.connect(self.model.load_from)
self.resultWindow = None
self.details_dialog = None
self.directories_dialog = DirectoriesDialog(self)
self.progress_window = ProgressWindow(
self.directories_dialog, self.model.progress_window
Expand Down Expand Up @@ -152,6 +152,9 @@ def _update_options(self):
self.model.options["match_scaled"] = self.prefs.match_scaled
self.model.options["picture_cache_type"] = self.prefs.picture_cache_type

if self.details_dialog:
self.details_dialog.update_options()

# --- Private
def _get_details_dialog_class(self):
if self.model.app_mode == AppMode.Picture:
Expand Down Expand Up @@ -284,6 +287,8 @@ def create_results_window(self):
self.resultWindow.setParent(None)
self.resultWindow = ResultWindow(self.directories_dialog, self)
self.details_dialog = self._get_details_dialog_class()(self.resultWindow, self)
self.resultWindow.addDockWidget(
Qt.BottomDockWidgetArea, self.details_dialog)

def show_results_window(self):
self.showResultsWindow()
Expand Down
22 changes: 20 additions & 2 deletions qt/details_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
# http://www.gnu.org/licenses/gpl-3.0.html

from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QDockWidget, QWidget

from .details_table import DetailsModel


class DetailsDialog(QMainWindow):
class DetailsDialog(QDockWidget):
def __init__(self, parent, app, **kwargs):
super().__init__(parent, Qt.Tool, **kwargs)
self.app = app
self.model = app.model.details_panel
self.setAllowedAreas(Qt.AllDockWidgetAreas)
self._setupUi()
self.update_options()
# To avoid saving uninitialized geometry on appWillSavePrefs, we track whether our dialog
# has been shown. If it has, we know that our geometry should be saved.
self._shown_once = False
Expand All @@ -36,6 +38,22 @@ def show(self):
self._shown_once = True
super().show()

def update_options(self):
# This disables the title bar (if we had not set one before already)
# essentially making it a simple floating window, not dockable anymore
if not self.app.prefs.details_dialog_titlebar_enabled \
and not self.titleBarWidget():
self.setTitleBarWidget(QWidget())
elif self.titleBarWidget() is not None:
# resets to the default title bar
self.setTitleBarWidget(None)

features = self.features()
if self.app.prefs.details_dialog_vertical_titlebar:
self.setFeatures(features | QDockWidget.DockWidgetVerticalTitleBar)
elif features & QDockWidget.DockWidgetVerticalTitleBar:
self.setFeatures(features ^ QDockWidget.DockWidgetVerticalTitleBar)

# --- Events
def appWillSavePrefs(self):
if self._shown_once:
Expand Down
3 changes: 2 additions & 1 deletion qt/details_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://www.gnu.org/licenses/gpl-3.0.html

from PyQt5.QtCore import Qt, QAbstractTableModel
from PyQt5.QtWidgets import QHeaderView, QTableView
from PyQt5.QtWidgets import QHeaderView, QTableView, QAbstractItemView

from hscommon.trans import trget

Expand Down Expand Up @@ -55,6 +55,7 @@ def __init__(self, *args):
self.setShowGrid(False)
self.setWordWrap(False)


def setModel(self, model):
QTableView.setModel(self, model)
# The model needs to be set to set header stuff
Expand Down
5 changes: 5 additions & 0 deletions qt/dg.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
<file alias="plus">../images/plus_8.png</file>
<file alias="minus">../images/minus_8.png</file>
<file alias="search_clear_13">../qtlib/images/search_clear_13.png</file>
<file alias="exchange">../images/exchange_purple_upscaled.png</file>
<file alias="zoom_in">../images/old_zoom_in.png</file>
<file alias="zoom_out">../images/old_zoom_out.png</file>
<file alias="zoom_original">../images/old_zoom_original.png</file>
<file alias="zoom_best_fit">../images/old_zoom_best_fit.png</file>
</qresource>
</RCC>
5 changes: 4 additions & 1 deletion qt/me/details_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# http://www.gnu.org/licenses/gpl-3.0.html

from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import QVBoxLayout, QAbstractItemView
from PyQt5.QtWidgets import QVBoxLayout, QAbstractItemView, QWidget

from hscommon.trans import trget
from ..details_dialog import DetailsDialog as DetailsDialogBase
Expand All @@ -27,3 +27,6 @@ def _setupUi(self):
self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableView.setShowGrid(False)
self.verticalLayout.addWidget(self.tableView)
self.centralWidget = QWidget()
self.centralWidget.setLayout(self.verticalLayout)
self.setWidget(self.centralWidget)
50 changes: 30 additions & 20 deletions qt/pe/details_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
QAbstractItemView, QSizePolicy, QGridLayout, QSplitter, QFrame)

from hscommon.trans import trget
from hscommon.plat import ISWINDOWS
from ..details_dialog import DetailsDialog as DetailsDialogBase
from ..details_table import DetailsTable
from .image_viewer import (
Expand All @@ -25,8 +26,7 @@ def _setupUi(self):
self.setWindowTitle(tr("Details"))
self.resize(502, 502)
self.setMinimumSize(QSize(250, 250))
self.splitter = QSplitter(Qt.Vertical, self)
self.setCentralWidget(self.splitter)
self.splitter = QSplitter(Qt.Vertical)
self.topFrame = QFrame()
self.topFrame.setFrameShape(QFrame.StyledPanel)
self.horizontalLayout = QGridLayout()
Expand Down Expand Up @@ -73,6 +73,8 @@ def _setupUi(self):
# Late population needed here for connections to the toolbar
self.vController.setupViewers(
self.selectedImageViewer, self.referenceImageViewer)
# self.setCentralWidget(self.splitter) # only as QMainWindow
self.setWidget(self.splitter) # only as QDockWidget

def _update(self):
if self.vController is None: # Not yet constructed!
Expand All @@ -89,23 +91,7 @@ def _update(self):

# --- Override
def resizeEvent(self, event):
# HACK referenceViewer might be 1 pixel shorter in width
# due to the toolbar in the middle keeping the same width,
# so resizing in the GridLayout's engine leads to not enough space
# left for the panel on the right.
# This ensures same size while shrinking at least:
self.horizontalLayout.setColumnMinimumWidth(
0, self.selectedImageViewer.size().width())
self.horizontalLayout.setColumnMinimumWidth(
2, self.selectedImageViewer.size().width())
# This works when expanding but it's ugly:
if self.selectedImageViewer.size().width() > self.referenceImageViewer.size().width():
# print(f"""Before selected size: {self.selectedImageViewer.size()}\n""",
# f"""Before reference size: {self.referenceImageViewer.size()}""")
self.selectedImageViewer.resize(self.referenceImageViewer.size())
# print(f"""After selected size: {self.selectedImageViewer.size()}\n""",
# f"""After reference size: {self.referenceImageViewer.size()}""")

self.ensure_same_sizes()
if self.vController is None or not self.vController.bestFit:
return
# Only update the scaled down pixmaps
Expand All @@ -117,10 +103,34 @@ def show(self):
self.tableView.setMaximumHeight(
self.tableView.rowHeight(1)
* self.tableModel.model.row_count()
+ self.tableView.verticalHeader().sectionSize(0))
+ self.tableView.verticalHeader().sectionSize(0)
# Windows seems to add a few pixels more to the table somehow
+ 5 if ISWINDOWS else 0)
DetailsDialogBase.show(self)
self.ensure_same_sizes()
self._update()

def ensure_same_sizes(self):
# HACK This ensures same size while shrinking.
# ReferenceViewer might be 1 pixel shorter in width
# due to the toolbar in the middle keeping the same width,
# so resizing in the GridLayout's engine leads to not enough space
# left for the panel on the right.
# This work as a QMainWindow, but doesn't work as a QDockWidget:
# resize can only grow. Might need some custom sizeHint somewhere...
# self.horizontalLayout.setColumnMinimumWidth(
# 0, self.selectedImageViewer.size().width())
# self.horizontalLayout.setColumnMinimumWidth(
# 2, self.selectedImageViewer.size().width())

# This works when expanding but it's ugly:
if self.selectedImageViewer.size().width() > self.referenceImageViewer.size().width():
# print(f"""Before selected size: {self.selectedImageViewer.size()}\n""",
# f"""Before reference size: {self.referenceImageViewer.size()}""")
self.selectedImageViewer.resize(self.referenceImageViewer.size())
# print(f"""After selected size: {self.selectedImageViewer.size()}\n""",
# f"""After reference size: {self.referenceImageViewer.size()}""")

# model --> view
def refresh(self):
DetailsDialogBase.refresh(self)
Expand Down
19 changes: 13 additions & 6 deletions qt/pe/image_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
QToolBar, QToolButton, QAction, QWidget, QScrollArea,
QApplication, QAbstractScrollArea, QStyle)
from hscommon.trans import trget
from hscommon.plat import ISLINUX
tr = trget("ui")

MAX_SCALE = 12.0
Expand All @@ -21,7 +22,7 @@ def createActions(actions, target):
for name, shortcut, icon, desc, func in actions:
action = QAction(target)
if icon:
action.setIcon(QIcon.fromTheme(icon))
action.setIcon(icon)
if shortcut:
action.setShortcut(shortcut)
action.setText(desc)
Expand All @@ -48,28 +49,32 @@ def setupActions(self, controller):
(
"actionZoomIn",
QKeySequence.ZoomIn,
"zoom-in",
QIcon.fromTheme("zoom-in") if ISLINUX
else QIcon(QPixmap(":/" + "zoom_in")),
tr("Increase zoom"),
controller.zoomIn,
),
(
"actionZoomOut",
QKeySequence.ZoomOut,
"zoom-out",
QIcon.fromTheme("zoom-out") if ISLINUX
else QIcon(QPixmap(":/" + "zoom_out")),
tr("Decrease zoom"),
controller.zoomOut,
),
(
"actionNormalSize",
tr("Ctrl+/"),
"zoom-original",
QIcon.fromTheme("zoom-original") if ISLINUX
else QIcon(QPixmap(":/" + "zoom_original")),
tr("Normal size"),
controller.zoomNormalSize,
),
(
"actionBestFit",
tr("Ctrl+*"),
"zoom-best-fit",
QIcon.fromTheme("zoom-best-fit") if ISLINUX
else QIcon(QPixmap(":/" + "zoom_best_fit")),
tr("Best fit"),
controller.zoomBestFit,
)
Expand All @@ -83,7 +88,9 @@ def createButtons(self):
self.buttonImgSwap.setToolButtonStyle(Qt.ToolButtonIconOnly)
self.buttonImgSwap.setIcon(
QIcon.fromTheme('view-refresh',
self.style().standardIcon(QStyle.SP_BrowserReload)))
self.style().standardIcon(QStyle.SP_BrowserReload))
if ISLINUX
else QIcon(QPixmap(":/" + "exchange")))
self.buttonImgSwap.setText('Swap images')
self.buttonImgSwap.setToolTip('Swap images')
self.buttonImgSwap.pressed.connect(self.controller.swapImages)
Expand Down
6 changes: 6 additions & 0 deletions qt/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def _load_values(self, settings):

self.tableFontSize = get("TableFontSize", self.tableFontSize)
self.reference_bold_font = get('ReferenceBoldFont', self.reference_bold_font)
self.details_dialog_titlebar_enabled = get('DetailsDialogTitleBarEnabled', self.details_dialog_titlebar_enabled)
self.details_dialog_vertical_titlebar = get('DetailsDialogVerticalTitleBar', self.details_dialog_vertical_titlebar)
self.resultWindowIsMaximized = get(
"ResultWindowIsMaximized", self.resultWindowIsMaximized
)
Expand Down Expand Up @@ -67,6 +69,8 @@ def reset(self):

self.tableFontSize = QApplication.font().pointSize()
self.reference_bold_font = True
self.details_dialog_titlebar_enabled = True
self.details_dialog_vertical_titlebar = True
self.resultWindowIsMaximized = False
self.resultWindowRect = None
self.directoriesWindowRect = None
Expand Down Expand Up @@ -100,6 +104,8 @@ def _save_values(self, settings):

set_("TableFontSize", self.tableFontSize)
set_('ReferenceBoldFont', self.reference_bold_font)
set_('DetailsDialogTitleBarEnabled', self.details_dialog_titlebar_enabled)
set_('DetailsDialogVerticalTitleBar', self.details_dialog_vertical_titlebar)
set_("ResultWindowIsMaximized", self.resultWindowIsMaximized)
self.set_rect("ResultWindowRect", self.resultWindowRect)
self.set_rect("DirectoriesWindowRect", self.directoriesWindowRect)
Expand Down
19 changes: 18 additions & 1 deletion qt/preferences_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,21 @@ def _setupBottomPart(self):
self.widgetsVLayout.addLayout(
horizontalWrap([self.fontSizeLabel, self.fontSizeSpinBox, None])
)
self._setupAddCheckbox("reference_bold_font", tr("Bold font for reference."))
self._setupAddCheckbox("reference_bold_font",
tr("Bold font for reference."))
self.widgetsVLayout.addWidget(self.reference_bold_font)

self._setupAddCheckbox("details_dialog_titlebar_enabled",
tr("Details dialog displays a title bar and is dockable"))
self.widgetsVLayout.addWidget(self.details_dialog_titlebar_enabled)
self._setupAddCheckbox("details_dialog_vertical_titlebar",
tr("Details dialog displays a vertical title bar."))
self.widgetsVLayout.addWidget(self.details_dialog_vertical_titlebar)
self.details_dialog_vertical_titlebar.setEnabled(
self.details_dialog_titlebar_enabled.isChecked())
self.details_dialog_titlebar_enabled.stateChanged.connect(
self.details_dialog_vertical_titlebar.setEnabled)

self.languageLabel = QLabel(tr("Language:"), self)
self.languageComboBox = QComboBox(self)
for lang in self.supportedLanguages:
Expand Down Expand Up @@ -190,6 +203,8 @@ def load(self, prefs=None):
setchecked(self.ignoreHardlinkMatches, prefs.ignore_hardlink_matches)
setchecked(self.debugModeBox, prefs.debug_mode)
setchecked(self.reference_bold_font, prefs.reference_bold_font)
setchecked(self.details_dialog_titlebar_enabled , prefs.details_dialog_titlebar_enabled)
setchecked(self.details_dialog_vertical_titlebar, prefs.details_dialog_vertical_titlebar)
self.copyMoveDestinationComboBox.setCurrentIndex(prefs.destination_type)
self.customCommandEdit.setText(prefs.custom_command)
self.fontSizeSpinBox.setValue(prefs.tableFontSize)
Expand All @@ -210,6 +225,8 @@ def save(self):
prefs.ignore_hardlink_matches = ischecked(self.ignoreHardlinkMatches)
prefs.debug_mode = ischecked(self.debugModeBox)
prefs.reference_bold_font = ischecked(self.reference_bold_font)
prefs.details_dialog_titlebar_enabled = ischecked(self.details_dialog_titlebar_enabled)
prefs.details_dialog_vertical_titlebar = ischecked(self.details_dialog_vertical_titlebar)
prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex()
prefs.custom_command = str(self.customCommandEdit.text())
prefs.tableFontSize = self.fontSizeSpinBox.value()
Expand Down
5 changes: 4 additions & 1 deletion qt/se/details_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# http://www.gnu.org/licenses/gpl-3.0.html

from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import QVBoxLayout, QAbstractItemView
from PyQt5.QtWidgets import QVBoxLayout, QAbstractItemView, QWidget

from hscommon.trans import trget
from ..details_dialog import DetailsDialog as DetailsDialogBase
Expand All @@ -27,3 +27,6 @@ def _setupUi(self):
self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableView.setShowGrid(False)
self.verticalLayout.addWidget(self.tableView)
self.centralWidget = QWidget()
self.centralWidget.setLayout(self.verticalLayout)
self.setWidget(self.centralWidget)
17 changes: 16 additions & 1 deletion qtlib/about_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _setupUi(self):
self.setWindowTitle(
tr("About {}").format(QCoreApplication.instance().applicationName())
)
self.resize(400, 190)
self.resize(400, 290)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
Expand All @@ -69,6 +69,21 @@ def _setupUi(self):
self.verticalLayout.addWidget(self.label_3)
self.label_3.setText(tr("Licensed under GPLv3"))
self.label = QLabel(self)
self.label_4 = QLabel(self)
self.label_4.setWordWrap(True)
self.label_4.setTextFormat(Qt.RichText)
self.label_4.setOpenExternalLinks(True)
self.label_4.setText(tr(
"""<img src=":/exchange" alt="Exchange" width="16" height="16"> icon
made by <a href="http://jasoncho.ca/"> Jason Cho</a> (used with permission).
<br>
<img src=":/zoom_in" alt="Zoom In" width="16" height="16">
<img src=":/zoom_out" alt="Zoom Out" width="16" height="16">
<img src=":/zoom_best_fit" alt="Zoomt Best Fit" width="16" height="16">
<img src=":/zoom_original" alt="Zoom Original" width="16" height="16">
icons made by <a href="https://findicons.com/pack/1035/human_o2">schollidesign</a>
(licensed under GPL)."""))
self.verticalLayout.addWidget(self.label_4)
font = QFont()
font.setWeight(75)
font.setBold(True)
Expand Down

0 comments on commit 8827209

Please sign in to comment.