Skip to content

Commit 3fc7693

Browse files
committed
.
1 parent 46031a0 commit 3fc7693

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

SuperLauncher/ModernLauncherIcon.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ public string FilePath
3535
{
3636
rFilePath = value;
3737
Icon icon = Icon.ExtractAssociatedIcon(rFilePath);
38-
if (Name == null)
38+
if (Title == null)
3939
{
4040
NameText.Text = Shared.ExtRemover(rFilePath);
4141
}
4242
else
4343
{
4444
NameText.Text = Title;
4545
}
46-
4746
LIcon.Source = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
4847
}
4948
}
@@ -69,8 +68,8 @@ public bool FilterFocus
6968
public ModernLauncherIcon(string FilePath, string Title = null)
7069
{
7170
InitializeComponent();
72-
this.FilePath = FilePath;
7371
this.Title = Title;
72+
this.FilePath = FilePath;
7473
}
7574
private readonly DoubleAnimation To1 = new()
7675
{
@@ -206,4 +205,4 @@ private void UserControl_Loaded(object sender, RoutedEventArgs e)
206205
BadgeTimer.Elapsed += BadgeTimer_Elapsed;
207206
}
208207
}
209-
}
208+
}

SuperLauncher/ModernLauncherIcons.xaml.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,19 @@ public void PopulateIcons()
5858
{
5959
try
6060
{
61+
XmlNodeList apps = Settings.Default.XDoc.SelectNodes("/SuperLauncher/AppList/App");
6162
IconPanel.Children.Clear();
62-
foreach (string filePath in Settings.Default.FileList)
63+
foreach (XmlNode app in apps)
6364
{
64-
if (!File.Exists(filePath)) continue;
65-
ModernLauncherIcon mli = new(filePath);
65+
if (!File.Exists(app.InnerText)) continue;
66+
67+
ModernLauncherIcon mli = new(app.InnerText);
6668
IconPanel.Children.Add(mli);
6769
}
6870
}
6971
catch
7072
{
71-
IconPanel.Children.Add(new ModernLauncherIcon(@"C:\Windows\System32\cmd.exe"));
73+
IconPanel.Children.Add(new ModernLauncherIcon(@"C:\Windows\System32\cmd.exe", "Command Prompt"));
7274
}
7375
}
7476
private void CommitIconsToFile()
@@ -77,8 +79,8 @@ private void CommitIconsToFile()
7779
foreach (ModernLauncherIcon mli in IconPanel.Children)
7880
{
7981
Settings.Default.FileList.Add(mli.FilePath);
80-
XmlNode node = Settings.Default.XDoc.SelectSingleNode("/SuperLauncher/AppList/App[. = \"" + mli.FilePath + "\"]");
81-
node.Attributes.
82+
//XmlNode node = Settings.Default.XDoc.SelectSingleNode("/SuperLauncher/AppList/App[. = \"" + mli.FilePath + "\"]");
83+
//node.Attributes.
8284
}
8385
Settings.Default.Save();
8486
}

SuperLauncher/ModernLauncherShared.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ public static class Shared
1313
{
1414
public static double ScalePixelsUp(this DpiScale DPI, double Pixels)
1515
{
16+
if (DPI.DpiScaleX == 0) return Pixels;
1617
return Pixels * DPI.DpiScaleX;
1718
}
1819
public static double ScalePixelsDown(this DpiScale DPI, double Pixels)
1920
{
21+
if (DPI.DpiScaleX == 0) return Pixels;
2022
return Pixels / DPI.DpiScaleX;
2123
}
2224
public static string GetArugement(string ArgumentName)

0 commit comments

Comments
 (0)