Verified Commit 275e9288 authored by Antonio Prcela's avatar Antonio Prcela
Browse files

Add option to change the background for fullscreen

parent 36bbb8c9
......@@ -52,7 +52,12 @@ ConfigDialog::ConfigDialog(QWidget* parent)
// General
widget = setupPage(mGeneralConfigPage);
mFullScreenBackgroundGroup = new InvisibleButtonGroup(widget);
mFullScreenBackgroundGroup->setObjectName(QStringLiteral("kcfg_FullScreenBackground"));
mFullScreenBackgroundGroup->addButton(mGeneralConfigPage.fullscreenBackgroundBlackRadioButton, int(FullScreenBackground::Black));
mFullScreenBackgroundGroup->addButton(mGeneralConfigPage.fullscreenBackgroundImageRadioButton, int(FullScreenBackground::Image));
mThumbnailActionsGroup = new InvisibleButtonGroup(widget);
mThumbnailActionsGroup->setObjectName(QStringLiteral("kcfg_ThumbnailActions"));
mThumbnailActionsGroup->addButton(mGeneralConfigPage.allButtonsThumbnailActionsRadioButton, int(ThumbnailActions::AllButtons));
......
......@@ -48,6 +48,7 @@ private:
InvisibleButtonGroup* mAlphaBackgroundModeGroup = nullptr;
InvisibleButtonGroup* mWheelBehaviorGroup = nullptr;
InvisibleButtonGroup* mAnimationMethodGroup = nullptr;
InvisibleButtonGroup* mFullScreenBackgroundGroup = nullptr;
InvisibleButtonGroup* mThumbnailActionsGroup = nullptr;
InvisibleButtonGroup* mZoomModeGroup = nullptr;
InvisibleButtonGroup* mThumbnailBarOrientationGroup = nullptr;
......
......@@ -12,7 +12,7 @@
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label">
<property name="text">
<string>Videos:</string>
</property>
......@@ -25,6 +25,13 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="kcfg_AutoplayVideos">
<property name="text">
<string>Automatically play</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_1">
<property name="orientation">
......@@ -42,7 +49,7 @@
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Background color:</string>
</property>
......@@ -122,14 +129,51 @@
</property>
</spacer>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label">
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>JPEG save quality:</string>
<string>Fullscreen background:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QRadioButton" name="fullscreenBackgroundImageRadioButton">
<property name="text">
<string>Dark gray texture</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QRadioButton" name="fullscreenBackgroundBlackRadioButton">
<property name="text">
<string>Black</string>
</property>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>JPEG save quality:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSlider" name="kcfg_JPEGQuality">
......@@ -187,7 +231,7 @@
</item>
</layout>
</item>
<item row="7" column="1">
<item row="9" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -203,41 +247,34 @@
</property>
</spacer>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_3">
<item row="10" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Thumbnail actions:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="10" column="1">
<widget class="QRadioButton" name="allButtonsThumbnailActionsRadioButton">
<property name="text">
<string>All buttons</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="11" column="1">
<widget class="QRadioButton" name="selectionOnlyThumbnailActionsRadioButton">
<property name="text">
<string>Show selection button only</string>
</property>
</widget>
</item>
<item row="10" column="1">
<item row="12" column="1">
<widget class="QRadioButton" name="noneThumbnailActionsRadioButton">
<property name="text">
<string>None</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="kcfg_AutoplayVideos">
<property name="text">
<string>Automatically play</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
......@@ -196,10 +196,15 @@ struct GvCorePrivate
adjustDefaultFullScreenPalette();
}
// FullScreenView has textured background
// FullScreenView has either a solid black color or a textured background
pal = mPalettes[GvCore::FullScreenPalette];
QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, "images/background.png");
QPixmap bgTexture(path);
QPixmap bgTexture(256,256);
if (Gwenview::GwenviewConfig::fullScreenBackground() == Gwenview::FullScreenBackground::Black) {
bgTexture.fill(Qt::black);
} else {
QString path = QStandardPaths::locate(QStandardPaths::AppDataLocation, "images/background.png");
bgTexture = path;
}
pal.setBrush(QPalette::Base, bgTexture);
mPalettes[GvCore::FullScreenViewPalette] = pal;
}
......
......@@ -724,6 +724,20 @@ Link an image.</para></listitem>
<para>Move the slider to change the color of the gray background in Browse and View mode from black (the leftmost position) to white (the rightmost position).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Fullscreen background</guilabel></term>
<listitem>
<para>Move the slider to change the color of the gray background in Browse and View mode from black (the leftmost position) to white (the rightmost position).</para>
<itemizedlist>
<listitem>
<para><guilabel>Black</guilabel> &mdash; Set the background color in fullscreen mode to black.</para>
</listitem>
<listitem>
<para><guilabel>Dark gray texture</guilabel> &mdash; Set the background in fullscreen mode to a dark gray texture.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>JPEG save quality</guilabel></term>
<listitem>
......
// vim: set tabstop=4 shiftwidth=4 expandtab:
/*
Gwenview: an image viewer
Copyright 2021 Antonio Prcela <antonio.prcela@gmail.com>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
*/
#ifndef FULLSCREENBACKGROUND_H
#define FULLSCREENBACKGROUND_H
// Qt
// KF
// Local
namespace Gwenview
{
namespace FullScreenBackground
{
/**
* This enum represents the different background types in fullscreen mode
*/
enum Enum {
Black,
Image
};
} // namespace FullScreenBackground
} // namespace Gwenview
#endif /* FULLSCREENBACKGROUND_H */
......@@ -8,6 +8,7 @@
<include>lib/zoommode.h</include>
<include>lib/thumbnailactions.h</include>
<include>lib/mousewheelbehavior.h</include>
<include>lib/fullscreenbackground.h</include>
<include>lib/documentview/documentview.h</include>
<include>lib/documentview/rasterimageview.h</include>
<include>lib/print/printoptionspage.h</include>
......@@ -94,7 +95,13 @@
<entry name="SideBarPage" type="String">
<default>information</default>
</entry>
<entry name="FullScreenBackground" type="Enum">
<choices name="Gwenview::FullScreenBackground::Enum">
<choice name="FullScreenBackground::Image"/>
<choice name="FullScreenBackground::Black"/>
</choices>
<default>FullScreenBackground::Image</default>
</entry>
<entry name="ThumbnailActions" type="Enum">
<choices name="Gwenview::ThumbnailActions::Enum">
<choice name="ThumbnailActions::AllButtons"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment