Skip to content

Commit

Permalink
style tweaks
Browse files Browse the repository at this point in the history
add tab hotkey

other fix
  • Loading branch information
Kosette committed Oct 7, 2024
1 parent d8ee7b7 commit 03c89c2
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 72 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
name: Linux CI
on:
workflow_dispatch:
push:
branches:
- "main"
paths-ignore:
- "docs/**"
- "**/.gitignore"
- "**/.dockerignore"
- LICENSE
- "**/*.md"
pull_request:
branches:
- "main"
paths-ignore:
- "docs/**"
- "**/.gitignore"
- "**/.dockerignore"
- LICENSE
- "**/*.md"
# push:
# branches:
# - "dev"
# paths-ignore:
# - "docs/**"
# - ".gitignore"
# - LICENSE
# - "*.md"
# pull_request:
# branches:
# - "dev"
# paths-ignore:
# - "docs/**"
# - ".gitignore"
# - LICENSE
# - "*.md"

jobs:
build:
Expand Down
57 changes: 31 additions & 26 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: CI Passing
on:
push:
tags:
- v*
workflow_dispatch:
# push:
# branches:
# - "dev"
# paths-ignore:
# - "docs/**"
# - "*.md"
# - LICENSE
# - .gitignore

env:
CARGO_TERM_COLOR: always
Expand All @@ -23,7 +29,7 @@ jobs:
os: ubuntu-latest
target: arm64
# x86_64-windows-gnu
- arch: x86_64-windows-gnu
- arch: ucrt-x86_64-windows-gnu
os: windows-latest
target: amd64

Expand All @@ -39,19 +45,19 @@ jobs:
with:
update: true
release: false
msystem: MINGW64
msystem: UCRT64
install: >-
mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-gcc
mingw-w64-x86_64-mpv
mingw-w64-x86_64-libadwaita
mingw-w64-x86_64-gstreamer
mingw-w64-x86_64-glib2
mingw-w64-x86_64-gst-plugins-base
mingw-w64-x86_64-gst-plugins-good
mingw-w64-x86_64-gst-plugins-bad
mingw-w64-x86_64-gst-plugins-ugly
mingw-w64-x86_64-gst-libav
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-mpv
mingw-w64-ucrt-x86_64-libadwaita
mingw-w64-ucrt-x86_64-gstreamer
mingw-w64-ucrt-x86_64-glib2
mingw-w64-ucrt-x86_64-gst-plugins-base
mingw-w64-ucrt-x86_64-gst-plugins-good
mingw-w64-ucrt-x86_64-gst-plugins-bad
mingw-w64-ucrt-x86_64-gst-plugins-ugly
mingw-w64-ucrt-x86_64-gst-libav
curl
- name: Build tsukimi-${{ matrix.arch }}
Expand All @@ -71,22 +77,22 @@ jobs:
cp $GITHUB_WORKSPACE/target/release/tsukimi.exe bin/
cp /mingw64/bin/gdbus.exe bin/
cp -r /mingw64/lib/gdk-pixbuf-2.0 lib/
cp -r /ucrt64/lib/gdk-pixbuf-2.0 lib/
find lib/gdk-pixbuf-2.0/2.10.0/loaders -type f ! \( -name "*-svg.dll" -o -name "*-png.dll" -o -name "*-jpeg.dll" \) -exec rm -f "{}" \;
cp -r /mingw64/lib/gio lib/
cp -r /ucrt64/lib/gio lib/
cp -r /mingw64/lib/gstreamer-1.0 lib/ && find lib/gstreamer-1.0 -type f ! -name "*.dll" -exec rm -f "{}" \;
cp -r /ucrt64/lib/gstreamer-1.0 lib/ && find lib/gstreamer-1.0 -type f ! -name "*.dll" -exec rm -f "{}" \;
cp -r $GITHUB_WORKSPACE/i18n/locale share/
cp -r /mingw64/share/glib-2.0 share/
cp -r /ucrt64/share/glib-2.0 share/
find share/glib-2.0/* -maxdepth 0 -type d ! -name "*schemas*" -exec rm -rf "{}" \;
mv $GITHUB_WORKSPACE/moe.tsuna.tsukimi.gschema.xml share/glib-2.0/schemas/
glib-compile-schemas.exe share/glib-2.0/schemas/
find share/glib-2.0/ -type f ! -name "*.compiled" -exec rm -f "{}" \;
cp -r /mingw64/share/icons share/
cp -r /ucrt64/share/icons share/
cp $GITHUB_WORKSPACE/resources/ui/icons/tsukimi.png share/icons/
rm -rf share/icons/hicolor && rm -rf share/icons/AdwaitaLegacy && rm -rf share/icons/Adwaita/scalable && rm -rf share/icons/Adwaita/cursors
rm -rf share/icons/Adwaita/16x16 && rm -rf share/icons/Adwaita/symbolic-up-to-32
Expand All @@ -103,8 +109,8 @@ jobs:
libgstxingmux.dll libgsty4menc.dll libgstzbar.dll
cd $GITHUB_WORKSPACE/artifact/tsukimi-x86_64-windows-gnu
ldd bin/tsukimi.exe | grep '\/mingw64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
find lib/ -type f -name "*.dll" -exec ldd "{}" \; | grep '\/mingw64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
ldd bin/tsukimi.exe | grep '\/ucrt64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
find lib/ -type f -name "*.dll" -exec ldd "{}" \; | grep '\/ucrt64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
- name: Create NSIS installer
if: ${{ matrix.arch == 'x86_64-windows-gnu' }}
Expand All @@ -119,8 +125,7 @@ jobs:
shell: powershell
run: |
cd artifact/tsukimi-x86_64-windows-gnu
7z.exe a ../tsukimi-x86_64-windows-gnu-gtk_416.7z ./*
mv ../tsukimi-x86_64-windows-gnu-installer.exe ../tsukimi-x86_64-windows-gnu-gtk_416-installer.exe
7z.exe a ../tsukimi-x86_64-windows-gnu.7z ./*
- name: Upload artifact
if: ${{ matrix.arch == 'x86_64-windows-gnu' }}
Expand Down Expand Up @@ -188,7 +193,7 @@ jobs:
- name: Get latest tag name
id: tag
run: echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
run: echo "TAG_NAME=v$(date '+%Y-%m-%d-%H%M%S')" >> $GITHUB_OUTPUT

- name: Upload Github Assets
uses: softprops/action-gh-release@v2
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ on:
workflow_dispatch:
push:
branches:
- "main"
- "dev"
paths-ignore:
- "docs/**"
- "**/.gitignore"
- "**/.dockerignore"
- ".gitignore"
- LICENSE
- "**/*.md"
pull_request:
branches:
- "main"
paths-ignore:
- "docs/**"
- "**/.gitignore"
- "**/.dockerignore"
- LICENSE
- "**/*.md"
- "*.md"
# pull_request:
# branches:
# - "dev"
# paths-ignore:
# - "docs/**"
# - ".gitignore"
# - LICENSE
# - "*.md"

env:
CARGO_TERM_COLOR: always
Expand All @@ -38,7 +36,6 @@ jobs:
# env: x86_64
- arch: ucrt64-x86_64-windows-gnu
os: windows-latest
target: x86_64-pc-windows-gnu
msystem: ucrt64
env: ucrt-x86_64

Expand Down Expand Up @@ -70,7 +67,7 @@ jobs:
mingw-w64-${{ matrix.env }}-gst-libav
curl
- name: Build tsukimi-${{ matrix.target }}
- name: Build tsukimi-${{ matrix.arch }}
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: msys2 {0}
run: |
Expand Down Expand Up @@ -151,8 +148,8 @@ jobs:
with:
name: tsukimi-${{matrix.arch}}
path: |
artifact/*.exe
artifact/*.7z
artifact/*.exe
artifact/*.sha512sum
compression-level: 0
retention-days: 3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/i18n
/.idea
/backup
/.cargo
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,6 @@ assets = [

[profile.release]
lto = true
codegen-units = 1
opt-level = "s"
strip = true
5 changes: 4 additions & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn load_css() {
border-radius: 999px;
margin: 3px;
}}
box>overlay>image {{
background-color: {};
border-radius: 999px;
Expand All @@ -67,6 +67,9 @@ pub fn load_css() {
accent_color
));

#[cfg(target_os = "windows")]
styles.push_str("window {box-shadow: 0px 0px 5px 0px rgba(5, 5, 5, 0.4);}");

provider.load_from_string(&styles);

gtk::style_context_add_provider_for_display(
Expand Down
1 change: 1 addition & 0 deletions src/ui/mpv/tsukimi_mpv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ const KEYSTRING_MAP: &[(&str, &str)] = &[
("", "Shift_R"),
("", "grave"),
("SPACE", " "),
("TAB", "\t"),
];

fn keyval_to_keystr(keyval: u32) -> Option<String> {
Expand Down
65 changes: 64 additions & 1 deletion src/ui/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ child {

.tu-listview > row {
margin: 10px;
border-radius:10px;
border-radius: 10px;
}

/* Starring */
Expand Down Expand Up @@ -192,3 +192,66 @@ row.expand.interacted.expanded image {
row image {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Scale UI Font to 125% */
* {
-gtk-dpi: 125;
}

/* GTK4 Window Controls Styles */
windowcontrols > button {
color: transparent;
min-width: 20px;
min-height: 20px;
padding: 0;
margin: 0 2px;
border: none;
border-radius: 50%;
transition: all 0.2s ease;
}

windowcontrols > button > image {
padding: 0;
-gtk-icon-size: 14px;
color: rgba(0, 0, 0, 0.7);
opacity: 0;
transition: opacity 0.2s ease, color 0.2s ease;
}

/* Button colors */
button.titlebutton.close,
windowcontrols > button.close {
background-color: #ff5f56;
}

button.titlebutton.maximize,
windowcontrols > button.maximize {
background-color: #ffbd2e;
}

button.titlebutton.minimize,
windowcontrols > button.minimize {
background-color: #27c93f;
}

/* Hover states */
windowcontrols > button:hover {
background-color: rgba(0, 0, 0, 0.1);
}

windowcontrols > button:hover > image {
opacity: 1;
color: rgba(0, 0, 0, 0.9);
}

windowcontrols > button.close:hover {
background-color: #ff5f56;
}

windowcontrols > button.maximize:hover {
background-color: #ffbd2e;
}

windowcontrols > button.minimize:hover {
background-color: #27c93f;
}
3 changes: 1 addition & 2 deletions src/ui/widgets/account_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,7 @@ impl AccountSettings {
}
};

let Some(texture) =
gtk::gdk::Texture::from_file(&gio::File::for_path(avatar)).ok()
let Some(texture) = gtk::gdk::Texture::from_file(&gio::File::for_path(avatar)).ok()
else {
return;
};
Expand Down
12 changes: 7 additions & 5 deletions src/ui/widgets/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,14 @@ impl ItemPage {
imp.episode_list_vec.replace(continue_play_list);
}
_ => {
let season_list = imp.season_list_vec.borrow();
let Some(season) = season_list.iter().find(|s| s.name == season_name) else {
return;
};
let season_id = {
let season_list = imp.season_list_vec.borrow();
let Some(season) = season_list.iter().find(|s| s.name == season_name) else {
return;
};

let season_id = season.id.clone();
season.id.clone()
};

let episodes = match spawn_tokio(async move {
EMBY_CLIENT.get_episodes(&series_id, &season_id).await
Expand Down
2 changes: 1 addition & 1 deletion src/ui/widgets/item_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ pub fn make_subtitle_version_choice(lang_list: Vec<String>) -> Option<usize> {
}

best_match_index
}
}
3 changes: 1 addition & 2 deletions src/ui/widgets/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@ impl Window {
}
};

let Some(texture) =
gtk::gdk::Texture::from_file(&gio::File::for_path(avatar)).ok()
let Some(texture) = gtk::gdk::Texture::from_file(&gio::File::for_path(avatar)).ok()
else {
obj.imp()
.avatar
Expand Down

0 comments on commit 03c89c2

Please sign in to comment.