Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
298a7734
Commit
298a7734
authored
Dec 17, 2021
by
Riccardo Degli Esposti
🍌
Committed by
Tomaz Canabrava
Dec 29, 2021
Browse files
Disable setting if wallpaper not set
parent
bc9a77d8
Pipeline
#115740
passed with stage
in 1 minute and 53 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/colorscheme/ColorSchemeEditor.cpp
View file @
298a7734
...
...
@@ -202,11 +202,13 @@ void ColorSchemeEditor::wallpaperPathChanged(const QString &path)
{
if
(
path
.
isEmpty
())
{
_colors
->
setWallpaper
(
path
,
_colors
->
wallpaper
()
->
style
(),
_colors
->
wallpaper
()
->
anchor
(),
_colors
->
wallpaper
()
->
opacity
());
enableWallpaperSettings
(
false
);
}
else
{
QFileInfo
i
(
path
);
if
(
i
.
exists
()
&&
i
.
isFile
()
&&
i
.
isReadable
())
{
_colors
->
setWallpaper
(
path
,
_colors
->
wallpaper
()
->
style
(),
_colors
->
wallpaper
()
->
anchor
(),
_colors
->
wallpaper
()
->
opacity
());
enableWallpaperSettings
(
true
);
}
}
}
...
...
@@ -321,6 +323,7 @@ void ColorSchemeEditor::setup(const std::shared_ptr<const ColorScheme> &scheme,
_ui
->
wallpaperScalingType
->
setCurrentIndex
(
scheme
->
wallpaper
()
->
style
());
_ui
->
wallpaperHorizontalAnchorSlider
->
setValue
(
ax
);
_ui
->
wallpaperVerticalAnchorSlider
->
setValue
(
ay
);
enableWallpaperSettings
(
!
scheme
->
wallpaper
()
->
isNull
());
}
void
ColorSchemeEditor
::
setupColorTable
(
const
std
::
shared_ptr
<
ColorScheme
>
&
colors
)
...
...
@@ -370,3 +373,11 @@ void ColorSchemeEditor::saveColorScheme()
{
Q_EMIT
colorSchemeSaveRequested
(
colorScheme
(),
_isNewScheme
);
}
void
ColorSchemeEditor
::
enableWallpaperSettings
(
bool
enable
)
{
_ui
->
wallpaperHorizontalAnchorSlider
->
setEnabled
(
enable
);
_ui
->
wallpaperVerticalAnchorSlider
->
setEnabled
(
enable
);
_ui
->
wallpaperTransparencySlider
->
setEnabled
(
enable
);
_ui
->
wallpaperScalingType
->
setEnabled
(
enable
);
}
src/colorscheme/ColorSchemeEditor.h
View file @
298a7734
...
...
@@ -81,6 +81,7 @@ private:
Q_DISABLE_COPY
(
ColorSchemeEditor
)
void
setupColorTable
(
const
std
::
shared_ptr
<
ColorScheme
>
&
table
);
void
enableWallpaperSettings
(
bool
enable
);
bool
_isNewScheme
;
Ui
::
ColorSchemeEditor
*
_ui
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment