Skip to content

Commit

Permalink
Merge pull request #358 from NeoCoderMatrix86/357-new-layout-is-not-o…
Browse files Browse the repository at this point in the history
…ptimized-for-smart-phones

New layout is not optimized for smart phones
  • Loading branch information
NeoCoderMatrix86 authored Jun 3, 2024
2 parents 4aee25f + f42feda commit 00d2fe9
Showing 1 changed file with 41 additions and 32 deletions.
73 changes: 41 additions & 32 deletions AudioCuesheetEditor/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ along with Foobar. If not, see
<CascadingValue Value="@this">
<Layout>
<LayoutHeader Fixed Position="Position.Sticky">
<Bar Background="Background.Dark" ThemeContrast="ThemeContrast.Dark" Breakpoint="Breakpoint.Medium">
<Bar Background="Background.Dark" ThemeContrast="ThemeContrast.Dark" Breakpoint="Breakpoint.Medium" Visible="false">
@if ((displayMenuBar) && (sidebar != null))
{
//Just a little a hack for displaying a toggler for the sidebar always and independent from the breakpoint of the top bar
<BarItem Padding="Padding.Is1.OnX">
<Button Color="Color.Secondary" Outline Clicked="() => sidebar.OnBreakpoint(sidebar.Visible)">
<Button Color="Color.Secondary" Outline Clicked="SideBarToogleClicked">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-menu-button-wide" viewBox="0 0 16 16">
<path d="M0 1.5A1.5 1.5 0 0 1 1.5 0h13A1.5 1.5 0 0 1 16 1.5v2A1.5 1.5 0 0 1 14.5 5h-13A1.5 1.5 0 0 1 0 3.5zM1.5 1a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5z" />
<path d="M2 2.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m10.823.323-.396-.396A.25.25 0 0 1 12.604 2h.792a.25.25 0 0 1 .177.427l-.396.396a.25.25 0 0 1-.354 0M0 8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm1 3v2a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2zm14-1V8a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v2zM2 8.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5" />
Expand All @@ -59,10 +59,10 @@ along with Foobar. If not, see
AudioCuesheetEditor
</BarLink>
</BarBrand>
<BarToggler />
<BarMenu>
@if (displayMenuBar)
{
@if (displayMenuBar)
{
<BarToggler />
<BarMenu>
<BarStart>
<BarItem Padding="Padding.Is1.OnX">
<Tooltip Text="@_localizer["Undo last change"]">
Expand All @@ -74,8 +74,6 @@ along with Foobar. If not, see
@_localizer["Undo"]
</Button>
</Tooltip>
</BarItem>
<BarItem Padding="Padding.Is1.OnX">
<Tooltip Text="@_localizer["Redo last change"]">
<Button Color="Color.Primary" Disabled="!_traceChangeManager.CanRedo" Clicked="() => _traceChangeManager.Redo()">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
Expand All @@ -87,36 +85,36 @@ along with Foobar. If not, see
</Tooltip>
</BarItem>
</BarStart>
}
<BarEnd>
<BarItem Padding="Padding.Is1.OnX" Display="Display.None.Block.OnWidescreen">
<CultureSelector />
</BarItem>
<BarItem Padding="Padding.Is1.OnX">
<BarDropdown RightAligned>
<BarDropdownToggle>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
<path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94" />
</svg>
</BarDropdownToggle>
<BarDropdownMenu Background="Background.Dark">
<BarDropdownItem To="help" TextColor="TextColor.White">@_localizer["Help"]</BarDropdownItem>
<BarDropdownItem To="about" TextColor="TextColor.White">@_localizer["About"]</BarDropdownItem>
<BarDropdownItem To="https://preview-audiocuesheeteditor.netlify.app/" Target="Target.Blank" TextColor="TextColor.White">@_localizer["Preview environment"]</BarDropdownItem>
</BarDropdownMenu>
</BarDropdown>
</BarItem>
</BarEnd>
</BarMenu>
</BarMenu>
}
<BarEnd>
<BarItem Padding="Padding.Is1.OnX" Display="Display.None.Block.OnWidescreen">
<CultureSelector />
</BarItem>
<BarItem Padding="Padding.Is1.OnX">
<BarDropdown RightAligned>
<BarDropdownToggle>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
<path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94" />
</svg>
</BarDropdownToggle>
<BarDropdownMenu Background="Background.Dark">
<BarDropdownItem To="help" TextColor="TextColor.White">@_localizer["Help"]</BarDropdownItem>
<BarDropdownItem To="about" TextColor="TextColor.White">@_localizer["About"]</BarDropdownItem>
<BarDropdownItem To="https://preview-audiocuesheeteditor.netlify.app/" Target="Target.Blank" TextColor="TextColor.White">@_localizer["Preview environment"]</BarDropdownItem>
</BarDropdownMenu>
</BarDropdown>
</BarItem>
</BarEnd>
</Bar>
</LayoutHeader>
<Layout Sider="displayMenuBar">
@if (displayMenuBar)
{
<LayoutSider>
<LayoutSiderContent>
<Bar @ref="sidebar" Background="Background.Dark" ThemeContrast="ThemeContrast.Dark" Mode="BarMode.VerticalInline">
<Bar @ref="sidebar" Background="Background.Dark" ThemeContrast="ThemeContrast.Dark" Mode="BarMode.VerticalInline" Visible="sidebarVisible">
<BarMenu>
<BarStart>
<BarItem Padding="Padding.Is1.OnY">
Expand Down Expand Up @@ -423,6 +421,7 @@ along with Foobar. If not, see
HotKeysContext? hotKeysContext;
ApplicationOptions? applicationOptions;
Boolean modalDownloadProjectfileVisible = false;
Boolean sidebarVisible = false;

OptionsDialog? optionsDialog;
ModalDialog? modalDialog;
Expand Down Expand Up @@ -867,7 +866,7 @@ along with Foobar. If not, see
await OnSelectedExportProfileSchemeFooterChanged(exportOptions.SelectedExportProfile.SchemeFooter += value);
break;
}

}
}

Expand All @@ -876,4 +875,14 @@ along with Foobar. If not, see
await _jsRuntime.InvokeVoidAsync("removeBeforeunload");
_navigationManager.NavigateTo(_navigationManager.Uri, true);
}

Task SideBarToogleClicked()
{
sidebarVisible = !sidebarVisible;
if (sidebar != null)
{
sidebar.OnBreakpoint(sidebarVisible);
}
return Task.CompletedTask;
}
}

0 comments on commit 00d2fe9

Please sign in to comment.