Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Aug 26, 2024
1 parent 3b490cd commit 46031a0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions SuperLauncher/ModernLauncherContextMenuIcon.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<local:ModernLauncherContextMenuButton x:Name="BtnRunAsAdmin" Text="Run as administrator" Icon="" MouseUp="BtnRunAsAdmin_MouseUp" />
<local:ModernLauncherContextMenuButton x:Name="BtnOpenLocation" Text="Open file location" Icon="" MouseUp="BtnOpenLocation_MouseUp" />
<Rectangle Fill="{DynamicResource BorderColorBrush}" Height="1" Margin="2" />
<local:ModernLauncherContextMenuButton x:Name="BtnRename" Text="Rename" Icon="" MouseUp="BtnRename_MouseUp" />
<local:ModernLauncherContextMenuButton x:Name="BtnUnpin" Text="Unpin from Super Launcher" Icon="" MouseUp="BtnUnpin_MouseUp" />
</StackPanel>
</Page>
4 changes: 4 additions & 0 deletions SuperLauncher/ModernLauncherContextMenuIcon.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,9 @@ private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
BtnRunAsAdmin.Opacity = 0.5;
}
}
private void BtnRename_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{

}
}
}
14 changes: 12 additions & 2 deletions SuperLauncher/ModernLauncherIcon.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public partial class ModernLauncherIcon : UserControl
public bool rFilterFocus = false;
public ModernLauncherBadge Badge;
public bool IsMouseDown = false;
public string Title = null;
public Timer BadgeTimer = new()
{
Interval = 1000,
Expand All @@ -34,7 +35,15 @@ public string FilePath
{
rFilePath = value;
Icon icon = Icon.ExtractAssociatedIcon(rFilePath);
NameText.Text = Shared.ExtRemover(rFilePath);
if (Name == null)
{
NameText.Text = Shared.ExtRemover(rFilePath);
}
else
{
NameText.Text = Title;
}

LIcon.Source = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
}
}
Expand All @@ -57,10 +66,11 @@ public bool FilterFocus
}
}
}
public ModernLauncherIcon(string FilePath)
public ModernLauncherIcon(string FilePath, string Title = null)
{
InitializeComponent();
this.FilePath = FilePath;
this.Title = Title;
}
private readonly DoubleAnimation To1 = new()
{
Expand Down
3 changes: 3 additions & 0 deletions SuperLauncher/ModernLauncherIcons.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Xml;

namespace SuperLauncher
{
Expand Down Expand Up @@ -76,6 +77,8 @@ private void CommitIconsToFile()
foreach (ModernLauncherIcon mli in IconPanel.Children)
{
Settings.Default.FileList.Add(mli.FilePath);
XmlNode node = Settings.Default.XDoc.SelectSingleNode("/SuperLauncher/AppList/App[. = \"" + mli.FilePath + "\"]");
node.Attributes.
}
Settings.Default.Save();
}
Expand Down
2 changes: 1 addition & 1 deletion SuperLauncher/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SettingsDefault
" <RememberMe>false</RememberMe>" +
" <UseLegacyUI>false</UseLegacyUI>" +
" <AppList>" +
" <App>C:\\Windows\\System32\\cmd.exe</App>" +
" <App Name=\"Command Prompt\">C:\\Windows\\System32\\cmd.exe</App>" +
" </AppList>" +
" <Width>390</Width>" +
" <Height>230</Height>" +
Expand Down

0 comments on commit 46031a0

Please sign in to comment.