Issue #75: Redesign of sidebar widget

This commit is contained in:
Jakub Melka
2023-07-28 14:54:21 +02:00
parent 28c6145459
commit 29ea799c20
11 changed files with 144 additions and 24 deletions

View File

@ -713,7 +713,6 @@ QVariant PDFThumbnailsItemModel::data(const QModelIndex& index, int role) const
QSizeF pageSize = page->getRotatedMediaBox().size(); QSizeF pageSize = page->getRotatedMediaBox().size();
pageSize.scale(m_thumbnailSize, m_thumbnailSize, Qt::KeepAspectRatio); pageSize.scale(m_thumbnailSize, m_thumbnailSize, Qt::KeepAspectRatio);
return pageSize.toSize() + QSize(m_extraItemWidthHint, m_extraItemHeighHint); return pageSize.toSize() + QSize(m_extraItemWidthHint, m_extraItemHeighHint);
break;
} }
default: default:

View File

@ -92,5 +92,11 @@
<file>resources/pce-same-width.svg</file> <file>resources/pce-same-width.svg</file>
<file>resources/certificate-manager.svg</file> <file>resources/certificate-manager.svg</file>
<file>resources/select-table.svg</file> <file>resources/select-table.svg</file>
<file>resources/sidebar-signature.png</file>
<file>resources/sidebar-speech.png</file>
<file>resources/sidebar-outline.png</file>
<file>resources/sidebar-thumbnails.png</file>
<file>resources/sidebar-visibility.png</file>
<file>resources/sidebar-attachment.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -1,4 +1,4 @@
// Copyright (C) 2019-2022 Jakub Melka // Copyright (C) 2019-2023 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
@ -113,7 +113,7 @@ PDFSidebarWidget::PDFSidebarWidget(pdf::PDFDrawWidgetProxy* proxy,
{ {
if (pageInfo.second.button) if (pageInfo.second.button)
{ {
connect(pageInfo.second.button, &QPushButton::clicked, this, &PDFSidebarWidget::onPageButtonClicked); connect(pageInfo.second.button, &QToolButton::clicked, this, &PDFSidebarWidget::onPageButtonClicked);
} }
} }

View File

@ -1,4 +1,4 @@
// Copyright (C) 2019-2021 Jakub Melka // Copyright (C) 2019-2023 Jakub Melka
// //
// This file is part of PDF4QT. // This file is part of PDF4QT.
// //
@ -24,6 +24,7 @@
#include <QWidget> #include <QWidget>
class QPushButton; class QPushButton;
class QToolButton;
class QWidget; class QWidget;
namespace Ui namespace Ui
@ -113,7 +114,7 @@ private:
struct PageInfo struct PageInfo
{ {
QPushButton* button = nullptr; QToolButton* button = nullptr;
QWidget* page = nullptr; QWidget* page = nullptr;
}; };

View File

@ -29,79 +29,193 @@
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QPushButton" name="bookmarksButton"> <widget class="QToolButton" name="bookmarksButton">
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Bookmarks</string> <string>Bookmarks</string>
</property> </property>
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/sidebar-outline.png</normaloff>:/resources/sidebar-outline.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="flat"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="thumbnailsButton"> <widget class="QToolButton" name="thumbnailsButton">
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Thumbnails</string> <string>Thumbnails</string>
</property> </property>
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/sidebar-thumbnails.png</normaloff>:/resources/sidebar-thumbnails.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="flat"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="optionalContentButton"> <widget class="QToolButton" name="optionalContentButton">
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Visibility</string> <string>Visibility</string>
</property> </property>
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/sidebar-visibility.png</normaloff>:/resources/sidebar-visibility.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="flat"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="attachmentsButton"> <widget class="QToolButton" name="attachmentsButton">
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Attachments</string> <string>Attachments</string>
</property> </property>
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/sidebar-attachment.png</normaloff>:/resources/sidebar-attachment.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="flat"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="speechButton"> <widget class="QToolButton" name="speechButton">
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Speech</string> <string>Speech</string>
</property> </property>
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/sidebar-speech.png</normaloff>:/resources/sidebar-speech.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="flat"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="signaturesButton"> <widget class="QToolButton" name="signaturesButton">
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Signatures</string> <string>Signatures</string>
</property> </property>
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/sidebar-signature.png</normaloff>:/resources/sidebar-signature.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="flat"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
@ -124,7 +238,7 @@
<item> <item>
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>6</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="emptyPage"/> <widget class="QWidget" name="emptyPage"/>
<widget class="QWidget" name="bookmarksPage"> <widget class="QWidget" name="bookmarksPage">
@ -175,7 +289,7 @@
<string>Synchronize thumbnails with current page</string> <string>Synchronize thumbnails with current page</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="pdfforqtviewer.qrc"> <iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/synchronize.svg</normaloff>:/resources/synchronize.svg</iconset> <normaloff>:/resources/synchronize.svg</normaloff>:/resources/synchronize.svg</iconset>
</property> </property>
<property name="checkable"> <property name="checkable">
@ -350,7 +464,7 @@
<item> <item>
<widget class="QToolButton" name="speechPlayButton"> <widget class="QToolButton" name="speechPlayButton">
<property name="icon"> <property name="icon">
<iconset resource="pdfforqtviewer.qrc"> <iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/play.svg</normaloff>:/resources/play.svg</iconset> <normaloff>:/resources/play.svg</normaloff>:/resources/play.svg</iconset>
</property> </property>
</widget> </widget>
@ -358,7 +472,7 @@
<item> <item>
<widget class="QToolButton" name="speechPauseButton"> <widget class="QToolButton" name="speechPauseButton">
<property name="icon"> <property name="icon">
<iconset resource="pdfforqtviewer.qrc"> <iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/pause.svg</normaloff>:/resources/pause.svg</iconset> <normaloff>:/resources/pause.svg</normaloff>:/resources/pause.svg</iconset>
</property> </property>
</widget> </widget>
@ -366,7 +480,7 @@
<item> <item>
<widget class="QToolButton" name="speechStopButton"> <widget class="QToolButton" name="speechStopButton">
<property name="icon"> <property name="icon">
<iconset resource="pdfforqtviewer.qrc"> <iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/stop.svg</normaloff>:/resources/stop.svg</iconset> <normaloff>:/resources/stop.svg</normaloff>:/resources/stop.svg</iconset>
</property> </property>
</widget> </widget>
@ -387,7 +501,7 @@
<item> <item>
<widget class="QToolButton" name="speechSynchronizeButton"> <widget class="QToolButton" name="speechSynchronizeButton">
<property name="icon"> <property name="icon">
<iconset resource="pdfforqtviewer.qrc"> <iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/synchronize.svg</normaloff>:/resources/synchronize.svg</iconset> <normaloff>:/resources/synchronize.svg</normaloff>:/resources/synchronize.svg</iconset>
</property> </property>
<property name="checkable"> <property name="checkable">
@ -441,7 +555,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="pdfforqtviewer.qrc"/> <include location="pdf4qtviewer.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB