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();
pageSize.scale(m_thumbnailSize, m_thumbnailSize, Qt::KeepAspectRatio);
return pageSize.toSize() + QSize(m_extraItemWidthHint, m_extraItemHeighHint);
break;
}
default:

View File

@ -92,5 +92,11 @@
<file>resources/pce-same-width.svg</file>
<file>resources/certificate-manager.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>
</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.
//
@ -113,7 +113,7 @@ PDFSidebarWidget::PDFSidebarWidget(pdf::PDFDrawWidgetProxy* proxy,
{
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.
//
@ -24,6 +24,7 @@
#include <QWidget>
class QPushButton;
class QToolButton;
class QWidget;
namespace Ui
@ -113,7 +114,7 @@ private:
struct PageInfo
{
QPushButton* button = nullptr;
QToolButton* button = nullptr;
QWidget* page = nullptr;
};

View File

@ -29,79 +29,193 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<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">
<string>Bookmarks</string>
</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">
<bool>true</bool>
</property>
<property name="flat">
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool>
</property>
</widget>
</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">
<string>Thumbnails</string>
</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">
<bool>true</bool>
</property>
<property name="flat">
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool>
</property>
</widget>
</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">
<string>Visibility</string>
</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">
<bool>true</bool>
</property>
<property name="flat">
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool>
</property>
</widget>
</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">
<string>Attachments</string>
</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">
<bool>true</bool>
</property>
<property name="flat">
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool>
</property>
</widget>
</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">
<string>Speech</string>
</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">
<bool>true</bool>
</property>
<property name="flat">
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool>
</property>
</widget>
</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">
<string>Signatures</string>
</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">
<bool>true</bool>
</property>
<property name="flat">
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="flat" stdset="0">
<bool>true</bool>
</property>
</widget>
@ -124,7 +238,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>6</number>
<number>2</number>
</property>
<widget class="QWidget" name="emptyPage"/>
<widget class="QWidget" name="bookmarksPage">
@ -175,7 +289,7 @@
<string>Synchronize thumbnails with current page</string>
</property>
<property name="icon">
<iconset resource="pdfforqtviewer.qrc">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/synchronize.svg</normaloff>:/resources/synchronize.svg</iconset>
</property>
<property name="checkable">
@ -350,7 +464,7 @@
<item>
<widget class="QToolButton" name="speechPlayButton">
<property name="icon">
<iconset resource="pdfforqtviewer.qrc">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/play.svg</normaloff>:/resources/play.svg</iconset>
</property>
</widget>
@ -358,7 +472,7 @@
<item>
<widget class="QToolButton" name="speechPauseButton">
<property name="icon">
<iconset resource="pdfforqtviewer.qrc">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/pause.svg</normaloff>:/resources/pause.svg</iconset>
</property>
</widget>
@ -366,7 +480,7 @@
<item>
<widget class="QToolButton" name="speechStopButton">
<property name="icon">
<iconset resource="pdfforqtviewer.qrc">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/stop.svg</normaloff>:/resources/stop.svg</iconset>
</property>
</widget>
@ -387,7 +501,7 @@
<item>
<widget class="QToolButton" name="speechSynchronizeButton">
<property name="icon">
<iconset resource="pdfforqtviewer.qrc">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/synchronize.svg</normaloff>:/resources/synchronize.svg</iconset>
</property>
<property name="checkable">
@ -441,7 +555,7 @@
</layout>
</widget>
<resources>
<include location="pdfforqtviewer.qrc"/>
<include location="pdf4qtviewer.qrc"/>
</resources>
<connections/>
</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