diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 976e7d8b..c24b35a6 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -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: diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 745f11bf..5895940f 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -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 @@ -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 @@ -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 }} @@ -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 @@ -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' }} @@ -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' }} @@ -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 diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 13abb063..8381a0d3 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -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 @@ -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 @@ -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: | @@ -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 diff --git a/.gitignore b/.gitignore index 3b42f00d..59a1e75a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /i18n /.idea /backup +/.cargo diff --git a/Cargo.toml b/Cargo.toml index 2b25996a..de874aa0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,3 +90,6 @@ assets = [ [profile.release] lto = true +codegen-units = 1 +opt-level = "s" +strip = true diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 86b0f9f2..e4ab02c3 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -54,7 +54,7 @@ pub fn load_css() { border-radius: 999px; margin: 3px; }} - + box>overlay>image {{ background-color: {}; border-radius: 999px; @@ -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( diff --git a/src/ui/mpv/tsukimi_mpv.rs b/src/ui/mpv/tsukimi_mpv.rs index e68bbdaa..800f379e 100644 --- a/src/ui/mpv/tsukimi_mpv.rs +++ b/src/ui/mpv/tsukimi_mpv.rs @@ -561,6 +561,7 @@ const KEYSTRING_MAP: &[(&str, &str)] = &[ ("", "Shift_R"), ("", "grave"), ("SPACE", " "), + ("TAB", "\t"), ]; fn keyval_to_keystr(keyval: u32) -> Option { diff --git a/src/ui/style.css b/src/ui/style.css index a9a86343..95cca148 100644 --- a/src/ui/style.css +++ b/src/ui/style.css @@ -64,7 +64,7 @@ child { .tu-listview > row { margin: 10px; - border-radius:10px; + border-radius: 10px; } /* Starring */ @@ -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; +} diff --git a/src/ui/widgets/account_settings.rs b/src/ui/widgets/account_settings.rs index f759131d..fd045527 100644 --- a/src/ui/widgets/account_settings.rs +++ b/src/ui/widgets/account_settings.rs @@ -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; }; diff --git a/src/ui/widgets/item.rs b/src/ui/widgets/item.rs index b5f72142..53b2e04f 100644 --- a/src/ui/widgets/item.rs +++ b/src/ui/widgets/item.rs @@ -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 diff --git a/src/ui/widgets/item_utils.rs b/src/ui/widgets/item_utils.rs index 72c33eaa..4e12d03c 100644 --- a/src/ui/widgets/item_utils.rs +++ b/src/ui/widgets/item_utils.rs @@ -66,4 +66,4 @@ pub fn make_subtitle_version_choice(lang_list: Vec) -> Option { } best_match_index -} \ No newline at end of file +} diff --git a/src/ui/widgets/window.rs b/src/ui/widgets/window.rs index ebb54ce7..c0c81687 100644 --- a/src/ui/widgets/window.rs +++ b/src/ui/widgets/window.rs @@ -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