Skip to content

Commit

Permalink
Fix icons not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Aug 29, 2024
1 parent 3258f3d commit e0aff68
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 64 deletions.
54 changes: 0 additions & 54 deletions apps/app-frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,6 @@
<title>Modrinth App</title>

<link rel="stylesheet" href="/src/assets/stylesheets/global.scss" />
<script src="https://modrinth.com/inmobi.js" async></script>
<style>
#qc-cmp2-ui {
background: var(--color-raised-bg);
border-radius: var(--radius-lg);
color: var(--color-base);
}

#qc-cmp2-ui::before {
background: var(--color-raised-bg);
}

#qc-cmp2-ui::after {
background: var(--color-raised-bg);
}

#qc-cmp2-ui button[mode='primary'] {
background: var(--color-brand);
color: var(--color-accent-contrast);
border-radius: var(--radius-lg);
border: none;
}

#qc-cmp2-ui button[mode='secondary'] {
background: var(--color-button-bg);
color: var(--color-base);
border-radius: var(--radius-lg);
border: none;
}

#qc-cmp2-ui button[mode='link'] {
color: var(--color-link);
}

#qc-cmp2-ui h2 {
color: var(--color-contrast);
font-size: 1.5rem;
}

#qc-cmp2-ui div,
#qc-cmp2-ui li,
#qc-cmp2-ui strong,
#qc-cmp2-ui p,
#qc-cmp2-ui .qc-cmp2-list-item-title,
#qc-cmp2-ui .qc-cmp2-expandable-info {
color: var(--color-base);
font-family: var(--font-standard);
}

#qc-cmp2-ui .qc-cmp2-toggle[aria-checked='true'] {
background-color: var(--color-brand);
border: 1px solid var(--color-brand);
}
</style>
</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions apps/app-frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { useInstall } from '@/store/install.js'
import { invoke } from '@tauri-apps/api/core'
import { open } from '@tauri-apps/plugin-shell'
import { get_opening_command, initialize_state } from '@/helpers/state'
import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state'
const themeStore = useTheming()
Expand Down Expand Up @@ -126,6 +127,7 @@ initialize_state()
})
const handleClose = async () => {
await saveWindowState(StateFlags.ALL)
await getCurrentWindow().close()
}
Expand Down
26 changes: 16 additions & 10 deletions apps/app/src/api/ads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {

const LINK_SCRIPT: &str = include_str!("ads-init.js");

// TODO: make ads work on linux

#[tauri::command]
pub async fn init_ads_window<R: Runtime>(
app: tauri::AppHandle<R>,
Expand All @@ -20,13 +22,14 @@ pub async fn init_ads_window<R: Runtime>(
width: f32,
height: f32,
) -> crate::api::Result<()> {
if let Some(webview) = app.webviews().get("ads-window") {
let _ = webview.set_position(LogicalPosition::new(x, y));
let _ = webview.set_size(LogicalSize::new(width, height));
} else {
if let Some(window) = app.get_window("main") {
let _ = window
.add_child(
#[cfg(not(target_os = "linux"))]
{
if let Some(webview) = app.webviews().get("ads-window") {
let _ = webview.set_position(LogicalPosition::new(x, y));
let _ = webview.set_size(LogicalSize::new(width, height));
} else {
if let Some(window) = app.get_window("main") {
let _ = window.add_child(
tauri::webview::WebviewBuilder::new(
"ads-window",
WebviewUrl::External(
Expand All @@ -40,6 +43,7 @@ pub async fn init_ads_window<R: Runtime>(
LogicalPosition::new(x, y),
LogicalSize::new(width, height),
);
}
}
}

Expand All @@ -50,9 +54,11 @@ pub async fn init_ads_window<R: Runtime>(
pub async fn hide_ads_window<R: Runtime>(
app: tauri::AppHandle<R>,
) -> crate::api::Result<()> {
if let Some(webview) = app.webviews().get("ads-window") {
let _ = webview
.set_position(LogicalPosition::new(-1000, -1000));
#[cfg(not(target_os = "linux"))]
{
if let Some(webview) = app.webviews().get("ads-window") {
let _ = webview.set_position(LogicalPosition::new(-1000, -1000));
}
}

Ok(())
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ async fn initialize_state(app: tauri::AppHandle) -> api::Result<()> {
let state = State::get().await?;
app.asset_protocol_scope()
.allow_directory(state.directories.caches_dir(), true)?;
app.asset_protocol_scope()
.allow_directory(state.directories.caches_dir().join("icons"), true)?;

Ok(())
}
Expand Down

0 comments on commit e0aff68

Please sign in to comment.