icon on click

This commit is contained in:
Matt Parker
2025-08-06 20:35:21 +10:00
parent 1adba5f9ce
commit 1ea10c8cc2
2 changed files with 7 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
<MudButton Style="min-width: 20px;" FullWidth="true">
<MudButton Style="min-width: 20px;" FullWidth="true" OnClick="@OnClick">
<MudStack AlignItems="AlignItems.Center" Spacing="0">
<MudIcon Icon="@Icon" Color="Color.Inherit"/>
<MudText Style="margin-top: 1px" Typo="Typo.caption">@Text</MudText>
@@ -11,4 +11,7 @@
[Parameter, EditorRequired]
public string? Text { get; set; }
[Parameter]
public EventCallback OnClick { get; set; }
}

View File

@@ -47,7 +47,7 @@
<MudStack AlignItems="AlignItems.Center" Spacing="1" Style="padding: 4px; height: 100%">
<SidebarIconButton Icon="@Icons.Material.Filled.FolderOpen" Text="Explorer" />
<MudSpacer />
<SidebarIconButton Icon="@Icons.Material.Filled.PlayArrow" Text="Run" />
<SidebarIconButton Icon="@Icons.Material.Filled.PlayArrow" Text="Run" OnClick="@RunDrawerToggle" />
<SidebarIconButton Icon="@Icons.Material.Filled.Terminal" Text="Terminal" />
</MudStack>
</MudPaper>
@@ -85,8 +85,10 @@
@code {
private bool _drawerOpen = true;
private bool _terminalDrawerOpen = false;
private bool _runDrawerOpen = true;
private void DrawerToggle() => _drawerOpen = !_drawerOpen;
private void TerminalDrawerToggle() => _terminalDrawerOpen = !_terminalDrawerOpen;
private void RunDrawerToggle() => _runDrawerOpen = !_runDrawerOpen;
private string? _solutionFilePath;
private SharpIdeSolutionModel? _solutionModel;