You've already forked AstralRinth
forked from didirus/AstralRinth
native decorations toggle (#541)
* add native decorations toggle * osname mac -> MacOS * remove newlines
This commit is contained in:
@@ -35,6 +35,8 @@ pub struct Settings {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub hide_on_process: bool,
|
pub hide_on_process: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
pub native_decorations: bool,
|
||||||
|
#[serde(default)]
|
||||||
pub default_page: DefaultPage,
|
pub default_page: DefaultPage,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub developer_mode: bool,
|
pub developer_mode: bool,
|
||||||
@@ -99,6 +101,7 @@ impl Settings {
|
|||||||
collapsed_navigation: false,
|
collapsed_navigation: false,
|
||||||
disable_discord_rpc: false,
|
disable_discord_rpc: false,
|
||||||
hide_on_process: false,
|
hide_on_process: false,
|
||||||
|
native_decorations: false,
|
||||||
default_page: DefaultPage::Home,
|
default_page: DefaultPage::Home,
|
||||||
developer_mode: false,
|
developer_mode: false,
|
||||||
opt_out_analytics: false,
|
opt_out_analytics: false,
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ const isLoading = ref(true)
|
|||||||
const videoPlaying = ref(false)
|
const videoPlaying = ref(false)
|
||||||
const offline = ref(false)
|
const offline = ref(false)
|
||||||
const showOnboarding = ref(false)
|
const showOnboarding = ref(false)
|
||||||
|
const nativeDecorations = ref(false)
|
||||||
|
|
||||||
const onboardingVideo = ref()
|
const onboardingVideo = ref()
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ const os = ref('')
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
initialize: async () => {
|
initialize: async () => {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
const { theme, opt_out_analytics, collapsed_navigation, advanced_rendering, fully_onboarded } =
|
const { native_decorations, theme, opt_out_analytics, collapsed_navigation, advanced_rendering, fully_onboarded } =
|
||||||
await get()
|
await get()
|
||||||
// video should play if the user is not on linux, and has not onboarded
|
// video should play if the user is not on linux, and has not onboarded
|
||||||
os.value = await getOS()
|
os.value = await getOS()
|
||||||
@@ -69,6 +70,9 @@ defineExpose({
|
|||||||
const version = await getVersion()
|
const version = await getVersion()
|
||||||
showOnboarding.value = !fully_onboarded
|
showOnboarding.value = !fully_onboarded
|
||||||
|
|
||||||
|
nativeDecorations.value = native_decorations
|
||||||
|
if (os !== "MacOS") appWindow.setDecorations(native_decorations)
|
||||||
|
|
||||||
themeStore.setThemeState(theme)
|
themeStore.setThemeState(theme)
|
||||||
themeStore.collapsedNavigation = collapsed_navigation
|
themeStore.collapsedNavigation = collapsed_navigation
|
||||||
themeStore.advancedRendering = advanced_rendering
|
themeStore.advancedRendering = advanced_rendering
|
||||||
@@ -341,7 +345,7 @@ command_listener(async (e) => {
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<section class="window-controls">
|
<section v-if="!nativeDecorations" class="window-controls">
|
||||||
<Button class="titlebar-button" icon-only @click="() => appWindow.minimize()">
|
<Button class="titlebar-button" icon-only @click="() => appWindow.minimize()">
|
||||||
<MinimizeIcon />
|
<MinimizeIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import JavaSelector from '@/components/ui/JavaSelector.vue'
|
|||||||
import ModrinthLoginScreen from '@/components/ui/tutorial/ModrinthLoginScreen.vue'
|
import ModrinthLoginScreen from '@/components/ui/tutorial/ModrinthLoginScreen.vue'
|
||||||
import { mixpanel_opt_out_tracking, mixpanel_opt_in_tracking } from '@/helpers/mixpanel'
|
import { mixpanel_opt_out_tracking, mixpanel_opt_in_tracking } from '@/helpers/mixpanel'
|
||||||
import { open } from '@tauri-apps/api/dialog'
|
import { open } from '@tauri-apps/api/dialog'
|
||||||
|
import { getOS } from '@/helpers/utils.js'
|
||||||
|
|
||||||
const pageOptions = ['Home', 'Library']
|
const pageOptions = ['Home', 'Library']
|
||||||
|
|
||||||
@@ -242,6 +243,24 @@ async function refreshDir() {
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="getOS() != 'MacOS'" class="adjacent-input">
|
||||||
|
<label for="native-decorations">
|
||||||
|
<span class="label__title">Native decorations</span>
|
||||||
|
<span class="label__description"
|
||||||
|
>Use system window frame (app restart required).</span
|
||||||
|
>
|
||||||
|
</label>
|
||||||
|
<Toggle
|
||||||
|
id="native-decorations"
|
||||||
|
:model-value="settings.native_decorations"
|
||||||
|
:checked="settings.native_decorations"
|
||||||
|
@update:model-value="
|
||||||
|
(e) => {
|
||||||
|
settings.native_decorations = e
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="adjacent-input">
|
<div class="adjacent-input">
|
||||||
<label for="opening-page">
|
<label for="opening-page">
|
||||||
<span class="label__title">Default landing page</span>
|
<span class="label__title">Default landing page</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user