homePageWidget: Add some icons

This commit is contained in:
Nicolas Mailloux 2022-07-20 11:55:43 -04:00
parent fa20895ad8
commit 79ed048c9a
5 changed files with 110 additions and 30 deletions

View file

@ -79,5 +79,7 @@
<file>resources/book_inverted.png</file> <file>resources/book_inverted.png</file>
<file>resources/arrow-left.png</file> <file>resources/arrow-left.png</file>
<file>resources/arrow-right.png</file> <file>resources/arrow-right.png</file>
<file>resources/file-text.png</file>
<file>resources/pin.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -10,6 +10,24 @@ homePageWidget::homePageWidget(QWidget *parent) :
ui(new Ui::homePageWidget) ui(new Ui::homePageWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
if(global::deviceID == "n705\n") {
stdIconWidth = sW / 52;
stdIconHeight = sH / 52;
}
else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
stdIconWidth = sW / 54;
stdIconHeight = sH / 54;
}
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
stdIconWidth = sW / 52.5;
stdIconHeight = sH / 52.5;
}
else {
stdIconWidth = sW / 54;
stdIconHeight = sH / 54;
}
ui->recentBooksIconLabel->setPixmap(QPixmap(":/resources/file-text.png").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation));
ui->pinnedBooksIconLabel->setPixmap(QPixmap(":/resources/pin.png").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation));
horizontalLayoutArray.resize(global::homePageWidget::recentBooksRowNumber); horizontalLayoutArray.resize(global::homePageWidget::recentBooksRowNumber);
verticalLayoutArray.resize(global::homePageWidget::recentBooksNumber); verticalLayoutArray.resize(global::homePageWidget::recentBooksNumber);

View file

@ -62,6 +62,18 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="recentBooksIconLabel">
<property name="text">
<string></string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="sizePolicy"> <property name="sizePolicy">
@ -77,6 +89,9 @@
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="styleSheet">
<string notr="true"></string>
</property>
<property name="text"> <property name="text">
<string>Continue reading</string> <string>Continue reading</string>
</property> </property>
@ -85,6 +100,21 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item> <item>
<widget class="Line" name="line_2"> <widget class="Line" name="line_2">
<property name="frameShadow"> <property name="frameShadow">
@ -121,6 +151,18 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="pinnedBooksIconLabel">
<property name="text">
<string></string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="font"> <property name="font">
@ -129,11 +171,29 @@
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="styleSheet">
<string notr="true"></string>
</property>
<property name="text"> <property name="text">
<string>Pinned books</string> <string>Pinned books</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item> <item>
<widget class="Line" name="line_3"> <widget class="Line" name="line_3">
<property name="frameShadow"> <property name="frameShadow">

BIN
resources/file-text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
resources/pin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB