mirror of
https://github.com/pjones/plasma-manager.git
synced 2024-10-04 03:07:17 +03:00
Apply suggestions from code review
Co-authored-by: Heitor Augusto <IAm.HeitorALN@proton.me>
This commit is contained in:
parent
0aab9f4b19
commit
aa17e6b456
@ -31,12 +31,12 @@
|
||||
# Values are taken from
|
||||
# https://invent.kde.org/plasma/kdeplasma-addons/-/blob/bc53d651cf60709396c9229f8c582ec8a9d2ee53/applets/mediaframe/package/contents/ui/ConfigGeneral.qml#L148-170
|
||||
wallpaperFillModeTypes = {
|
||||
"Stretch" = 0; # a.k.a. Scaled
|
||||
"PreserveAspectFit" = 1; # a.k.a. Scaled Keep Proportions
|
||||
"PreserveAspectCrop" = 2; # a.k.a. Scaled And Cropped
|
||||
"Tile" = 3;
|
||||
"TileVertically" = 4;
|
||||
"TileHorizontally" = 5;
|
||||
"Pad" = 6; # a.k.a. Centered
|
||||
"stretch" = 0; # a.k.a. Scaled
|
||||
"preserveAspectFit" = 1; # a.k.a. Scaled Keep Proportions
|
||||
"preserveAspectCrop" = 2; # a.k.a. Scaled And Cropped
|
||||
"tile" = 3;
|
||||
"tileVertically" = 4;
|
||||
"tileHorizontally" = 5;
|
||||
"pad" = 6; # a.k.a. Centered
|
||||
};
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ in
|
||||
"\"" + (builtins.toString path) + "\"" else
|
||||
"[" + (builtins.concatStringsSep "," (map (s: "\"" + s + "\"") path)) + "]"});
|
||||
desktop.writeConfig("SlideInterval", "${builtins.toString cfg.workspace.wallpaperSlideShow.interval}");
|
||||
desktop.writeConfig("FillMode", "${builtins.toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");
|
||||
${lib.optionalString (cfg.workspace.wallpaperFillMode != null) ''desktop.writeConfig("FillMode", "${builtins.toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");''}
|
||||
}
|
||||
'' else "");
|
||||
wallpaperPOTD = (if (cfg.workspace.wallpaperPictureOfTheDay != null) then ''
|
||||
@ -224,7 +224,7 @@ in
|
||||
desktop.currentConfigGroup = ["Wallpaper", "org.kde.potd", "General"];
|
||||
desktop.writeConfig("Provider", "${cfg.workspace.wallpaperPictureOfTheDay.provider}");
|
||||
desktop.writeConfig("UpdateOverMeteredConnection", "${if (cfg.workspace.wallpaperPictureOfTheDay.updateOverMeteredConnection) then "1" else "0"}");
|
||||
desktop.writeConfig("FillMode", "${builtins.toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");
|
||||
${lib.optionalString (cfg.workspace.wallpaperFillMode != null) ''desktop.writeConfig("FillMode", "${builtins.toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode}}");''}
|
||||
}
|
||||
'' else "");
|
||||
wallpaperPlainColor = (if (cfg.workspace.wallpaperPlainColor != null) then ''
|
||||
|
@ -164,10 +164,10 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
wallpaperFillMode = with lib.types; lib.mkOption {
|
||||
type = enum (lib.attrNames wallpaperFillModeTypes);
|
||||
default = "Stretch";
|
||||
example = "PreserveAspectFit";
|
||||
wallpaperFillMode = lib.mkOption {
|
||||
type = with lib.types; nullOr (enum (builtins.attrNames wallpaperFillModeTypes));
|
||||
default = null;
|
||||
example = "stretch";
|
||||
description = ''
|
||||
Defines how the wallpaper should be displayed on the screen.
|
||||
Applies only to wallpaperPictureOfTheDay or wallpaperSlideShow.
|
||||
|
Loading…
Reference in New Issue
Block a user