-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,13 @@ You should have received a copy of the GNU General Public License | |
mailto:[email protected] | ||
http://www.mgth.fr | ||
*/ | ||
|
||
using System; | ||
using System.ComponentModel; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using HLab.Mvvm; | ||
using HLab.Notify; | ||
using LittleBigMouse.ScreenConfigs; | ||
|
@@ -155,6 +158,51 @@ public Viewbox Logo | |
get => this.Get<Viewbox>(); private set => this.Set(value); | ||
} | ||
|
||
[TriggedOn("Model.Config.WallpaperStyle")] | ||
public Stretch WallPaperStretch => this.Get(() => | ||
{ | ||
switch (Model.Config.WallpaperStyle) | ||
{ | ||
case 0: | ||
return Stretch.None; | ||
case 2: | ||
return Stretch.Fill; | ||
case 6: | ||
return Stretch.Uniform; | ||
case 10: | ||
return Stretch.UniformToFill; | ||
case 22: // stretched across all screens | ||
default: | ||
return Stretch.None; | ||
} | ||
}); | ||
|
||
[TriggedOn(nameof(WallPaperStretch))] | ||
[TriggedOn("Model.Config.WallPaperPath")] | ||
public Image WallPaper => this.Get(() => | ||
{ | ||
try | ||
{ | ||
return new Image | ||
{ | ||
Source = new BitmapImage(new Uri(Model.Config.WallPaperPath)), | ||
Stretch = WallPaperStretch, | ||
HorizontalAlignment = HorizontalAlignment.Center | ||
}; | ||
} | ||
catch (Exception) | ||
{ | ||
return null; | ||
} | ||
}); | ||
|
||
public Brush BackgroundColor => this.Get(() => new SolidColorBrush( | ||
Color.FromRgb( | ||
(byte)Model.Config.BackGroundColor[0], | ||
(byte)Model.Config.BackGroundColor[1], | ||
(byte)Model.Config.BackGroundColor[2] | ||
))); | ||
|
||
[TriggedOn(nameof(Model),"Monitor","Edid","ManufacturerCode")] | ||
public void UpdateLogo() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1079,6 +1079,8 @@ public void PlaceAuto(IEnumerable<Screen> screens) | |
else InMm.Y -= bottom; | ||
} | ||
} | ||
} | ||
|
||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters