@@ -14,7 +14,7 @@ import {
1414} from "src/logger/constants" ;
1515import Logger from "js-logger" ;
1616import { stringToLogLevel } from "src/logger" ;
17- import { CollapseStyle , TExplorerView } from "src/types" ;
17+ import { CollapseStyle , CoverImageFit , TExplorerView } from "src/types" ;
1818import EventManager from "src/event/event-manager" ;
1919import LicenseKeyApp from "../svelte/license-key-app/index.svelte" ;
2020import ImageSourceApp from "../svelte/image-source-app/index.svelte" ;
@@ -312,6 +312,26 @@ export default class VaultExplorerSettingsTab extends PluginSettingTab {
312312 } )
313313 ) ;
314314
315+ new Setting ( containerEl )
316+ . setName ( "Cover image fit" )
317+ . setDesc ( "Set the default cover image fit" )
318+ . addDropdown ( ( cb ) =>
319+ cb
320+ . addOptions ( {
321+ cover : "Cover" ,
322+ contain : "Contain" ,
323+ } )
324+ . setValue ( this . plugin . settings . views . grid . coverImageFit )
325+ . onChange ( async ( value ) => {
326+ this . plugin . settings . views . grid . coverImageFit =
327+ value as CoverImageFit ;
328+ await this . plugin . saveSettings ( ) ;
329+ EventManager . getInstance ( ) . emit (
330+ PluginEvent . COVER_IMAGE_FIT_SETTING_CHANGE
331+ ) ;
332+ } )
333+ ) ;
334+
315335 new Setting ( containerEl ) . setName ( "List view" ) . setHeading ( ) ;
316336
317337 new Setting ( containerEl )
@@ -443,9 +463,9 @@ export default class VaultExplorerSettingsTab extends PluginSettingTab {
443463 ) ;
444464
445465 new Setting ( containerEl )
446- . setName ( "Image property" )
466+ . setName ( "Cover image property" )
447467 . setDesc (
448- "Property used to store an image. This must be a text property."
468+ "Property used to store a cover image. This must be a text property."
449469 )
450470 . addDropdown ( ( dropdown ) =>
451471 dropdown
@@ -460,6 +480,24 @@ export default class VaultExplorerSettingsTab extends PluginSettingTab {
460480 } )
461481 ) ;
462482
483+ new Setting ( containerEl )
484+ . setName ( "Cover image fit property" )
485+ . setDesc (
486+ "Property used to store the cover image fit. This must be a text property."
487+ )
488+ . addDropdown ( ( dropdown ) =>
489+ dropdown
490+ . addOptions ( getDropdownOptionsForProperties ( textProperties ) )
491+ . setValue ( this . plugin . settings . properties . coverImageFit )
492+ . onChange ( async ( value ) => {
493+ this . plugin . settings . properties . coverImageFit = value ;
494+ await this . plugin . saveSettings ( ) ;
495+ EventManager . getInstance ( ) . emit (
496+ PluginEvent . PROPERTY_SETTING_CHANGE
497+ ) ;
498+ } )
499+ ) ;
500+
463501 new Setting ( containerEl )
464502 . setName ( "URL property" )
465503 . setDesc (
0 commit comments