diff --git a/README.ja.md b/README.ja.md index 39ec1fc..792037b 100644 --- a/README.ja.md +++ b/README.ja.md @@ -40,8 +40,8 @@ UAC が**別の管理者**のパスワードを求めた場合でも、ユーザ |---|---|---| | **rust-search** | すべての NTFS ドライブを対象にしたファイル検索 (Alt+Space)。topbar があれば Win+R で実行モードが開きます: 履歴、フォルダー補完 (Tab)、Ctrl+Shift+Enter で管理者として実行 | Windows 検索サービスを無効にし、SearchHost.exe をブロックし、タスクバーの検索ボックスを隠します | | **rtaskmgr-win32** | タスク マネージャー (Ctrl+Shift+Esc で開きます) | `taskmgr.exe` がこちらにリダイレクトされます (システム ファイルには手を加えません)。ディスク クリーナー **rs-du** も一緒にインストールされます。**速度**ページには、オプトインで元に戻せるスイッチがあります: ゲーム / 作業プロファイル (バックグラウンド サービスを停止し、ランチャーや同期アプリを終了し、再び起動)、メモリのスタンバイ キャッシュの消去 (今すぐ、または topbar の実行中に自動で)、Windows のスタート メニュー、ウィジェット、スマートフォン連携のプロセスのブロック、サードパーティの更新ツールの代わりに週 1 回の `winget upgrade`、ビルド キャッシュとゲーム ライブラリの Defender 除外、高速 NTFS (最終アクセス日時と 8.3 名なし)、広告をブロックする hosts ファイル。**スタートアップ**には、ログオン/起動タスクとサードパーティの自動開始サービスも一覧表示され、それぞれが直近の起動をどれだけ遅くしたか (Windows 自身の起動ログ) が分かります。**遅い原因**には、ドライバーの時間 (DPC/割り込み)、ハングしたウィンドウ、遅いディスク、起動時間が表示されます。アンインストールするとすべて元に戻ります | -| **topbar** | Windows 11 風の下部バー: ウィンドウ、時計、音量、メニュー | 標準のタスクバーを隠します。**reshell** (ホットキー: Win+Ctrl+1/2/3 と Win+\` でデスクトップを切り替え (Win+1..9 はバーのアプリ ボタンを開く)、Win+D でデスクトップを表示、Win+I で設定、Win+E でファイル マネージャーを開く。バーが落ちた場合はタスクバーを復活させます)、**rs-du**、PowerShell プロファイル内のブロック (`zoxide`、`grep`=rg、`ll`=eza、`cat`=bat。存在しなければ何もしません) も一緒にインストールされます。歯車メニューには短いページがあります: テーマ、色と透明度 (バーと WinRust ウィンドウの任意の色、バーの不透明度)、テンプレート (自分の外観を保存して切り替え)、バー (下/左/右の端、サイズ、自動的に隠す、Windows 10 のように左端にボタンを配置)、すべて初期設定に戻す | -| **rust-explorer** | タブ付きのファイル マネージャーとデスクトップ | フォルダーとドライブはこちらで開き、**エクスプローラーはシェルではなくなります** (topbar が失敗した場合は自動的に戻ります)。新規インストールでは、値をバックアップできる場合に、InventorySvc、lfsvc、DoSvc のスタートアップ設定と svchost のグループ化しきい値を調整します。独自のコピー機能 (SSD では複数ファイルを同時に、大きなファイルはバッファなし、進行状況はステータス行に表示) と、右クリックの **ZIP に圧縮** (全コア) / **ここに展開** (ZIP と 7z)、独自の ZIP エンジン。`.zip` はフォルダーのように開きます (閲覧、コピー、ファイルを開く)。他のプログラムからの「フォルダーで表示」ではファイルが選択されます (ダウンロード、ドキュメント、デスクトップ、ピクチャ、ミュージック、ビデオ、ピン留めしたフォルダーなど。ウィンドウが開いていなくても動作)。マウスの戻る/進むボタンが使えます。デスクトップを右クリックするとアイコンを隠せます。topbar が必要です | +| **topbar** | Windows 11 風のバー: ウィンドウ、時計、音量、メニュー | 標準のタスクバーを隠します。**reshell** (ホットキー: Win+Ctrl+1/2/3 と Win+\` でデスクトップを切り替え (Win+1..9 はバーのアプリ ボタンを開く)、Win+D でデスクトップを表示、Win+I で設定、Win+E でファイル マネージャーを開く。バーが落ちた場合はタスクバーを復活させます)、**rs-du**、PowerShell プロファイル内のブロック (`zoxide`、`grep`=rg、`ll`=eza、`cat`=bat。存在しなければ何もしません) も一緒にインストールされます。歯車メニューには短いページがあります: テーマ、色と透明度 (バーと WinRust ウィンドウの任意の色、バーの不透明度)、テンプレート (自分の外観を保存して切り替え)、バー (下/上/左/右の端、サイズ、アイコンのサイズ、自動的に隠す、Windows 10 のように左端にボタンを配置)、すべて初期設定に戻す | +| **rust-explorer** | タブ付きのファイル マネージャーとデスクトップ | フォルダーとドライブはこちらで開き、**エクスプローラーはシェルではなくなります** (topbar が失敗した場合は自動的に戻ります)。新規インストールでは、値をバックアップできる場合に、InventorySvc、lfsvc、DoSvc のスタートアップ設定と svchost のグループ化しきい値を調整します。独自のコピー機能 (SSD では複数ファイルを同時に、大きなファイルはバッファなし、進行状況はステータス行に表示) と、右クリックの **ZIP に圧縮** (全コア) / **ここに展開** (ZIP と 7z)、独自の ZIP エンジン。`.zip` はフォルダーのように開きます (閲覧、コピー、ファイルを開く)。他のプログラムからの「フォルダーで表示」ではファイルが選択されます (ダウンロード、ドキュメント、デスクトップ、ピクチャ、ミュージック、ビデオ、ピン留めしたフォルダーなど。ウィンドウが開いていなくても動作)。マウスの戻る/進むボタンが使えます。デスクトップを右クリックするとアイコンを隠したり、アイコンと文字のサイズを変更したりできます。topbar が必要です | | **wiztree** | ディスク使用量マップ (スタートの「WinRust Disk」) | ファイルとショートカット以外は何も変更しません | | **photoview** | 高速なフォト ビューアー | 「プログラムから開く」に追加します (既定にはなりません) | | **rust-settings** | Rust 製の設定: ディスプレイ (解像度、リフレッシュ レート)、サウンド (音量)、電源プランとドライブの空き容量、アプリごとの音量とデバイスの選択、夜間モード、ドラッグによるディスプレイの配置、ネットワーク アダプター、すべてのアダプターでの Wi-Fi (パスワードまたは 802.1X)、VPN とプロキシ、Bluetooth、アプリ、Windows Update、ディスク クリーンアップ、テーマ、バージョン情報 | ファイルとショートカット以外は何も変更しません。Win+I とバーのメニューは Windows の設定の代わりにこのウィンドウを開きます (ごく一部のあまり使われないページのみ、引き続きシステムの設定を開きます) | diff --git a/README.md b/README.md index 589f961..55b4940 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,8 @@ On uninstall, `rust-explorer` restores the service startup values and the svchos |---|---|---| | **rust-search** | File search over all NTFS drives, Alt+Space. With topbar, Win+R opens its Run mode: history, folder completion (Tab), Ctrl+Shift+Enter runs as administrator | Disables the Windows Search service, blocks SearchHost.exe, hides the taskbar search box | | **rtaskmgr-win32** | Task Manager (Ctrl+Shift+Esc opens it) | `taskmgr.exe` is redirected to it (the system file is untouched). Also installs the **rs-du** disk cleaner. The **Speed** page has opt-in, reversible switches: Game / Work profiles (stop background services, close launchers or sync apps, start them again), clear the memory standby cache (now, or automatically while topbar runs), block the Windows Start menu, widgets and Phone Link processes, one weekly `winget upgrade` instead of third-party updaters, Defender exclusions for build caches and game libraries, faster NTFS (no last-access times, no 8.3 names), an ad-blocking hosts file. **Startup** also lists logon/boot tasks and third-party auto-start services, with how much each slowed the last boots (Windows' own boot log). **What's slow** shows driver time (DPC/interrupts), hung windows, slow disk and boot times. Uninstall turns all of it back | -| **topbar** | A Windows 11-style bottom bar: windows, clock, volume, menus | Hides the stock taskbar. Also installs **reshell** (hotkeys: Win+Ctrl+1/2/3 and Win+\` switch desktops (Win+1..9 open the bar's app buttons), Win+D shows the desktop, Win+I opens Settings, Win+E the file manager; brings the taskbar back if the bar dies), **rs-du**, and a block in your PowerShell profile (`zoxide`, `grep`=rg, `ll`=eza, `cat`=bat; does nothing if they are missing). The gear menu has short pages: Theme, Colors and transparency (any colour of the bar and the WinRust windows, the bar's opacity), Templates (save your own looks and switch between them), the bar (bottom / left / right edge, size, auto-hide, buttons at the left end like Windows 10) and Reset everything to defaults | -| **rust-explorer** | A file manager with tabs, and the desktop | Folders and drives open in it; **Explorer stops being the shell** (comes back by itself if topbar fails). On fresh installs, adjusts the startup settings of InventorySvc, lfsvc and DoSvc, and the svchost grouping threshold, when their values can be backed up. Its own copier (several files at once on SSDs, unbuffered for big files, progress in the status line) and right-click **Compress to ZIP** (all cores) / **Extract here** (ZIP and 7z), our own ZIP engine; a `.zip` opens like a folder (browse, copy out, open files from it). "Show in folder" from other programs selects the file (for the common folders: Downloads, Documents, Desktop, Pictures, Music, Videos and pinned ones, also when no window is open); the mouse back / forward buttons work; right click the desktop to hide its icons. Requires topbar | +| **topbar** | A Windows 11-style bar: windows, clock, volume, menus | Hides the stock taskbar. Also installs **reshell** (hotkeys: Win+Ctrl+1/2/3 and Win+\` switch desktops (Win+1..9 open the bar's app buttons), Win+D shows the desktop, Win+I opens Settings, Win+E the file manager; brings the taskbar back if the bar dies), **rs-du**, and a block in your PowerShell profile (`zoxide`, `grep`=rg, `ll`=eza, `cat`=bat; does nothing if they are missing). The gear menu has short pages: Theme, Colors and transparency (any colour of the bar and the WinRust windows, the bar's opacity), Templates (save your own looks and switch between them), the bar (bottom / top / left / right edge, size, adjustable icon size, auto-hide, buttons at the left end like Windows 10) and Reset everything to defaults | +| **rust-explorer** | A file manager with tabs, and the desktop | Folders and drives open in it; **Explorer stops being the shell** (comes back by itself if topbar fails). On fresh installs, adjusts the startup settings of InventorySvc, lfsvc and DoSvc, and the svchost grouping threshold, when their values can be backed up. Its own copier (several files at once on SSDs, unbuffered for big files, progress in the status line) and right-click **Compress to ZIP** (all cores) / **Extract here** (ZIP and 7z), our own ZIP engine; a `.zip` opens like a folder (browse, copy out, open files from it). "Show in folder" from other programs selects the file (for the common folders: Downloads, Documents, Desktop, Pictures, Music, Videos and pinned ones, also when no window is open); the mouse back / forward buttons work; right click the desktop to hide or scale its icons and text. Requires topbar | | **wiztree** | A disk-usage map ("WinRust Disk" in Start) | Nothing, apart from the file and a shortcut | | **photoview** | A fast photo viewer | Adds it to "Open with" (it does not become the default) | | **rust-settings** | Settings in Rust: display (resolution, refresh rate), sound (volume), power plan and drive space, per-app volume and device choice, night light, display arrangement by dragging, network adapters, Wi-Fi on every adapter (password or 802.1X), VPN and proxy, Bluetooth, apps, Windows Update, disk cleanup, theme, about | Nothing, apart from the file and a shortcut. Win+I and the bar menus open this window instead of Windows Settings (only a few rare pages still open the system ones) | @@ -91,7 +91,7 @@ The gear at the left end of the bar opens **Bar settings**; a style picked on it | **Windows 98** (BETA) | Classic grey with a navy accent, square corners, Tahoma. Colours, corners and font only: no 3D bevels yet | | **Windows 7** (BETA) | Aero-like glass blue with white text | -The gear menu also sets the bar position (bottom, left or right: a side bar shows icons only and the panels open next to it) and auto-hide. +The gear menu also sets the bar position (bottom, top, left or right: a side bar shows icons only and the panels open next to it), icon size, and auto-hide. Ctrl+Alt+T tiles the open windows. The choice is stored in `%ProgramData%\WinRust\style.txt`. diff --git a/README.pt-BR.md b/README.pt-BR.md index 198359a..a5fa35b 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -40,8 +40,8 @@ Na desinstalação, o `rust-explorer` restaura os valores de inicialização dos |---|---|---| | **rust-search** | Pesquisa de arquivos em todas as unidades NTFS, Alt+Espaço. Com a topbar, Win+R abre o modo Executar dele: histórico, preenchimento de pastas (Tab), Ctrl+Shift+Enter executa como administrador | Desativa o serviço Pesquisa do Windows, bloqueia o SearchHost.exe, oculta a caixa de pesquisa da barra de tarefas | | **rtaskmgr-win32** | Gerenciador de Tarefas (Ctrl+Shift+Esc o abre) | O `taskmgr.exe` é redirecionado para ele (o arquivo do sistema não é tocado). Também instala o limpador de disco **rs-du**. A página **Velocidade** tem interruptores opcionais e reversíveis: perfis Jogo / Trabalho (param serviços em segundo plano, fecham lançadores ou apps de sincronização e os iniciam de novo), limpar o cache de espera da memória (agora, ou automaticamente enquanto a topbar roda), bloquear os processos do menu Iniciar, widgets e Phone Link do Windows, um `winget upgrade` semanal no lugar de atualizadores de terceiros, exclusões do Defender para caches de compilação e bibliotecas de jogos, NTFS mais rápido (sem horário do último acesso, sem nomes 8.3), um arquivo hosts que bloqueia anúncios. **Inicialização** também lista tarefas de logon/boot e serviços de início automático de terceiros, com o quanto cada um atrasou as últimas inicializações (o log de boot do próprio Windows). **O que está lento** mostra o tempo de drivers (DPC/interrupções), janelas travadas, disco lento e tempos de boot. Desinstalar reverte tudo | -| **topbar** | Uma barra inferior no estilo do Windows 11: janelas, relógio, volume, menus | Oculta a barra de tarefas original. Também instala o **reshell** (atalhos: Win+Ctrl+1/2/3 e Win+\` alternam áreas de trabalho (Win+1..9 abrem os botões de apps da barra), Win+D mostra a área de trabalho, Win+I abre as Configurações, Win+E o gerenciador de arquivos; traz a barra de tarefas de volta se a barra morrer), o **rs-du** e um bloco no seu perfil do PowerShell (`zoxide`, `grep`=rg, `ll`=eza, `cat`=bat; não faz nada se faltarem). O menu da engrenagem tem páginas curtas: Tema, Cores e transparência (qualquer cor da barra e das janelas da WinRust, a opacidade da barra), Modelos (salve suas próprias aparências e alterne entre elas), a barra (borda inferior / esquerda / direita, tamanho, ocultar automaticamente, botões na ponta esquerda como no Windows 10) e Restaurar tudo ao padrão | -| **rust-explorer** | Um gerenciador de arquivos com abas, e a área de trabalho | Pastas e unidades abrem nele; **o Explorer deixa de ser o shell** (volta sozinho se a topbar falhar). Em instalações novas, ajusta as configurações de inicialização de InventorySvc, lfsvc e DoSvc, e o limite de agrupamento do svchost, quando os valores podem ser salvos em backup. Copiador próprio (vários arquivos ao mesmo tempo em SSDs, sem buffer para arquivos grandes, progresso na linha de status) e, no botão direito, **Compactar em ZIP** (todos os núcleos) / **Extrair aqui** (ZIP e 7z), com nosso próprio motor de ZIP; um `.zip` abre como uma pasta (navegar, copiar para fora, abrir arquivos dele). "Mostrar na pasta" a partir de outros programas seleciona o arquivo (para as pastas comuns: Downloads, Documentos, Área de Trabalho, Imagens, Músicas, Vídeos e as fixadas, também quando nenhuma janela está aberta); os botões voltar / avançar do mouse funcionam; clique com o botão direito na área de trabalho para ocultar os ícones. Requer a topbar | +| **topbar** | Uma barra no estilo do Windows 11: janelas, relógio, volume, menus | Oculta a barra de tarefas original. Também instala o **reshell** (atalhos: Win+Ctrl+1/2/3 e Win+\` alternam áreas de trabalho (Win+1..9 abrem os botões de apps da barra), Win+D mostra a área de trabalho, Win+I abre as Configurações, Win+E o gerenciador de arquivos; traz a barra de tarefas de volta se a barra morrer), o **rs-du** e um bloco no seu perfil do PowerShell (`zoxide`, `grep`=rg, `ll`=eza, `cat`=bat; não faz nada se faltarem). O menu da engrenagem tem páginas curtas: Tema, Cores e transparência (qualquer cor da barra e das janelas da WinRust, a opacidade da barra), Modelos (salve suas próprias aparências e alterne entre elas), a barra (borda inferior / superior / esquerda / direita, tamanho, tamanho dos ícones, ocultar automaticamente, botões na ponta esquerda como no Windows 10) e Restaurar tudo ao padrão | +| **rust-explorer** | Um gerenciador de arquivos com abas, e a área de trabalho | Pastas e unidades abrem nele; **o Explorer deixa de ser o shell** (volta sozinho se a topbar falhar). Em instalações novas, ajusta as configurações de inicialização de InventorySvc, lfsvc e DoSvc, e o limite de agrupamento do svchost, quando os valores podem ser salvos em backup. Copiador próprio (vários arquivos ao mesmo tempo em SSDs, sem buffer para arquivos grandes, progresso na linha de status) e, no botão direito, **Compactar em ZIP** (todos os núcleos) / **Extrair aqui** (ZIP e 7z), com nosso próprio motor de ZIP; um `.zip` abre como uma pasta (navegar, copiar para fora, abrir arquivos dele). "Mostrar na pasta" a partir de outros programas seleciona o arquivo (para as pastas comuns: Downloads, Documentos, Área de Trabalho, Imagens, Músicas, Vídeos e as fixadas, também quando nenhuma janela está aberta); os botões voltar / avançar do mouse funcionam; clique com o botão direito na área de trabalho para ocultar ou redimensionar os ícones e o texto. Requer a topbar | | **wiztree** | Um mapa de uso de disco ("WinRust Disk" no Iniciar) | Nada, além do arquivo e de um atalho | | **photoview** | Um visualizador de fotos rápido | Adiciona-o a "Abrir com" (ele não vira o padrão) | | **rust-settings** | Configurações em Rust: tela (resolução, taxa de atualização), som (volume), plano de energia e espaço nas unidades, volume por app e escolha de dispositivo, luz noturna, disposição das telas por arrastar, adaptadores de rede, Wi-Fi em qualquer adaptador (senha ou 802.1X), VPN e proxy, Bluetooth, apps, Windows Update, limpeza de disco, tema, sobre | Nada, além do arquivo e de um atalho. Win+I e os menus da barra abrem esta janela no lugar das Configurações do Windows (só algumas páginas raras ainda abrem as do sistema) | diff --git a/README.ru.md b/README.ru.md index 34ae2a2..dda90ef 100644 --- a/README.ru.md +++ b/README.ru.md @@ -65,8 +65,8 @@ |---|---|---| | **rust-search** | Поиск файлов по всем NTFS-дискам, Alt+Space. С topbar Win+R открывает его режим «Выполнить»: история, дополнение папок (Tab), Ctrl+Shift+Enter запускает от администратора | Отключается служба поиска Windows, блокируется SearchHost.exe, прячется строка поиска на панели | | **rtaskmgr-win32** | Диспетчер задач (Ctrl+Shift+Esc открывает его) | Запуск `taskmgr.exe` перенаправляется на него (системный файл не трогается). Заодно ставится чистильщик диска **rs-du**. На странице **«Ускорение»** обратимые переключатели, всё по желанию: профили «Игра» и «Работа» (останавливают фоновые службы, закрывают лаунчеры или синхронизацию и потом запускают обратно), очистка кэша памяти standby (сейчас или автоматически, пока работает topbar), блок процессов меню «Пуск» Windows, виджетов и «Связи с телефоном», один еженедельный `winget upgrade` вместо сторонних апдейтеров, исключения Defender для кэшей сборки и библиотек игр, быстрее NTFS (без времени последнего доступа и имён 8.3), блокировка рекламы через hosts. **«Автозагрузка»** показывает ещё задачи при входе и загрузке и сторонние службы с автозапуском и то, насколько каждая замедлила последние загрузки (журнал самой Windows). **«Что тормозит»** показывает время драйверов (DPC и прерывания), зависшие окна, медленный диск и время загрузки. Удаление всё возвращает | -| **topbar** | Нижняя панель в стиле Windows 11: окна, часы, громкость, меню | Стандартная панель задач прячется. Заодно ставятся **reshell** (хоткеи: Win+Ctrl+1/2/3 и Win+\` переключают рабочие столы (Win+1..9 открывают кнопки панели), Win+D показывает рабочий стол, Win+I открывает Параметры, Win+E файловый менеджер; возвращает панель задач, если topbar упал), **rs-du** и блок в профиле PowerShell (`zoxide`, `grep`=rg, `ll`=eza, `cat`=bat; молчит, если их нет). Меню шестерёнки разбито на короткие страницы: «Тема», «Цвета и прозрачность» (любой цвет панели и окон WinRust, прозрачность панели), «Шаблоны» (свои наборы вида, переключаются в один клик), «Панель» (снизу / слева / справа, размер, автоскрытие, кнопки слева, как в Windows 10) и «Сбросить всё по умолчанию» | -| **rust-explorer** | Файловый менеджер с вкладками и рабочий стол | Папки и диски открываются в нём; **Проводник перестаёт быть оболочкой** (возвращается сам, если topbar не работает). При первой установке меняются настройки запуска InventorySvc, lfsvc и DoSvc, а также порог группировки svchost, если удалось сохранить их исходные значения. Своё копирование (на SSD несколько файлов сразу, большие файлы без кэша, прогресс в строке состояния) и в меню правой кнопки **«Compress to ZIP»** (на всех ядрах) и **«Extract here»** (ZIP и 7z), собственный ZIP-движок; `.zip` открывается как папка (просмотр, копирование наружу, открытие файлов оттуда). «Показать в папке» из других программ выделяет файл (для частых папок: Загрузки, Документы, Рабочий стол, Изображения, Музыка, Видео и закреплённых, в том числе когда окно не открыто); работают кнопки мыши «назад / вперёд»; ПКМ по рабочему столу скрывает значки. Нужен topbar | +| **topbar** | Панель в стиле Windows 11: окна, часы, громкость, меню | Стандартная панель задач прячется. Заодно ставятся **reshell** (хоткеи: Win+Ctrl+1/2/3 и Win+\` переключают рабочие столы (Win+1..9 открывают кнопки панели), Win+D показывает рабочий стол, Win+I открывает Параметры, Win+E файловый менеджер; возвращает панель задач, если topbar упал), **rs-du** и блок в профиле PowerShell (`zoxide`, `grep`=rg, `ll`=eza, `cat`=bat; молчит, если их нет). Меню шестерёнки разбито на короткие страницы: «Тема», «Цвета и прозрачность» (любой цвет панели и окон WinRust, прозрачность панели), «Шаблоны» (свои наборы вида, переключаются в один клик), «Панель» (снизу / сверху / слева / справа, размер, размер значков, автоскрытие, кнопки слева, как в Windows 10) и «Сбросить всё по умолчанию» | +| **rust-explorer** | Файловый менеджер с вкладками и рабочий стол | Папки и диски открываются в нём; **Проводник перестаёт быть оболочкой** (возвращается сам, если topbar не работает). При первой установке меняются настройки запуска InventorySvc, lfsvc и DoSvc, а также порог группировки svchost, если удалось сохранить их исходные значения. Своё копирование (на SSD несколько файлов сразу, большие файлы без кэша, прогресс в строке состояния) и в меню правой кнопки **«Compress to ZIP»** (на всех ядрах) и **«Extract here»** (ZIP и 7z), собственный ZIP-движок; `.zip` открывается как папка (просмотр, копирование наружу, открытие файлов оттуда). «Показать в папке» из других программ выделяет файл (для частых папок: Загрузки, Документы, Рабочий стол, Изображения, Музыка, Видео и закреплённых, в том числе когда окно не открыто); работают кнопки мыши «назад / вперёд»; ПКМ по рабочему столу скрывает значки или меняет их размер вместе с текстом. Нужен topbar | | **wiztree** | Карта занятого места на диске («WinRust Disk» в Пуске) | Ничего, кроме файла и ярлыка | | **photoview** | Быстрый просмотр фото | Добавляется в «Открыть с помощью» (по умолчанию не назначается) | | **rust-settings** | Параметры на Rust: экран (разрешение, частота, ночной свет, расположение мониторов перетаскиванием), звук (устройства, громкость по приложениям), схема питания, место на дисках и очистка, сетевые адаптеры, Wi-Fi на всех адаптерах (пароль или 802.1X), VPN и прокси, Bluetooth, приложения, Центр обновления, тема, о системе | Ничего, кроме файла и ярлыка. Win+I и меню панели открывают это окно вместо Параметров Windows (лишь несколько редких разделов по-прежнему системные) | diff --git a/common/src/style.rs b/common/src/style.rs index ca9d141..b4b70f5 100644 --- a/common/src/style.rs +++ b/common/src/style.rs @@ -150,6 +150,7 @@ pub fn set_align_left(on: bool) { #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum Side { Bottom, + Top, Left, Right, } @@ -157,6 +158,7 @@ pub enum Side { impl Side { pub fn parse(s: &str) -> Side { match s.trim().to_ascii_lowercase().as_str() { + "top" => Side::Top, "left" => Side::Left, "right" => Side::Right, _ => Side::Bottom, @@ -165,6 +167,7 @@ impl Side { pub fn name(self) -> &'static str { match self { Side::Bottom => "bottom", + Side::Top => "top", Side::Left => "left", Side::Right => "right", } @@ -183,10 +186,11 @@ fn side_code(s: Side) -> u8 { Side::Bottom => 0, Side::Left => 1, Side::Right => 2, + Side::Top => 3, } } -/// The bar's edge (bottom unless %ProgramData%\WinRust\side.txt says left or right). Re-read once a second. +/// The bar's edge (bottom unless %ProgramData%\WinRust\side.txt names another edge). Re-read once a second. pub fn side() -> Side { if now_ms().saturating_sub(SIDE_AT.load(Relaxed)) > 1000 { let s = side_file().and_then(|f| std::fs::read_to_string(f).ok()).map_or(Side::Bottom, |s| Side::parse(&s)); @@ -196,6 +200,7 @@ pub fn side() -> Side { match SIDE.load(Relaxed) { 1 => Side::Left, 2 => Side::Right, + 3 => Side::Top, _ => Side::Bottom, } } @@ -442,6 +447,7 @@ pub fn save_themes(t: &[Theme]) { pub fn reset_all() { set_side(Side::Bottom); set_bar_size(1); + set_icon_size(60); set_autohide(false); set_align_left(false); set_alttab_per_monitor(false); @@ -613,8 +619,19 @@ mod tests { assert_eq!(Side::parse(" Left "), Side::Left); assert_eq!(Side::parse("right"), Side::Right); + assert_eq!(Side::parse("TOP"), Side::Top); + assert_eq!(Side::Top.name(), "top"); assert_eq!(Side::parse(""), Side::Bottom); - assert_eq!(Side::parse("top"), Side::Bottom); + assert_eq!(Side::parse("unknown"), Side::Bottom); + } + + #[test] + fn icon_size_accepts_menu_choices_only() { + assert_eq!(valid_icon_size(50), Some(50)); + assert_eq!(valid_icon_size(60), Some(60)); + assert_eq!(valid_icon_size(100), Some(100)); + assert_eq!(valid_icon_size(55), None); + assert_eq!(valid_icon_size(0), None); } } @@ -644,6 +661,38 @@ pub fn set_bar_size(v: u8) { } } +fn icon_size_file() -> Option { + std::env::var_os("ProgramData").map(|p| PathBuf::from(p).join("WinRust").join("icon-size.txt")) +} + +static ICON_SIZE: AtomicU8 = AtomicU8::new(60); +static ICON_SIZE_AT: AtomicU64 = AtomicU64::new(0); + +fn valid_icon_size(v: u8) -> Option { + (50..=100).contains(&v).then_some(v).filter(|v| v % 10 == 0) +} + +/// Icon size as a percentage of the original, 60 by default. Re-read once a second. +pub fn icon_size() -> u8 { + if now_ms().saturating_sub(ICON_SIZE_AT.load(Relaxed)) > 1000 { + let v = icon_size_file().and_then(|f| std::fs::read_to_string(f).ok()) + .and_then(|s| s.trim().parse::().ok()).and_then(valid_icon_size).unwrap_or(60); + ICON_SIZE.store(v, Relaxed); + ICON_SIZE_AT.store(now_ms(), Relaxed); + } + ICON_SIZE.load(Relaxed) +} + +pub fn set_icon_size(v: u8) { + let v = valid_icon_size(v).unwrap_or(60); + ICON_SIZE.store(v, Relaxed); + ICON_SIZE_AT.store(now_ms(), Relaxed); + if let Some(f) = icon_size_file() { + let _ = std::fs::create_dir_all(f.parent().unwrap()); + let _ = std::fs::write(f, v.to_string()); + } +} + fn mon_file() -> Option { std::env::var_os("ProgramData").map(|p| PathBuf::from(p).join("WinRust").join("alttab-monitor.txt")) } diff --git a/plugins/rust-explorer/src/main.rs b/plugins/rust-explorer/src/main.rs index 6fedc67..c0222cd 100644 --- a/plugins/rust-explorer/src/main.rs +++ b/plugins/rust-explorer/src/main.rs @@ -38,7 +38,12 @@ fn virt() -> (i32, i32, i32, i32) { fn place_desk_list(list: HWND) { let (vx, vy, ..) = virt(); let (sw, sh) = unsafe { (GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)) }; - unsafe { MoveWindow(list, -vx, -vy + desk_top(), sw, (sh - desk_top() - desk_bottom()).max(0), 1) }; + let (top, bottom) = (desk_top(), desk_bottom()); + let (x, y, h) = (-vx, -vy + top, (sh - top - bottom).max(0)); + let mut current: RECT = unsafe { std::mem::zeroed() }; + let unchanged = unsafe { GetWindowRect(list, &mut current) != 0 } + && (current.left, current.top, current.right, current.bottom) == (0, top, sw, top + h); + if !unchanged { unsafe { MoveWindow(list, x, y, sw, h, 1) }; } } /// Renders the wallpaper for the current monitor layout (at start and when monitors change), freeing the old one. fn reload_wall() { @@ -73,18 +78,39 @@ fn saved_place() -> Option<(bool, RECT)> { let (max, r) = parse_place(&fs::read_to_string(place_file()).ok()?)?; (!unsafe { MonitorFromRect(&r, MONITOR_DEFAULTTONULL) }.is_null()).then_some((max, r)) } -/// What the bar reserves at the top and bottom of the screen: the work area topbar sets when there is no explorer. +/// The bar's actual edge wins over a stale work area left by its previous position. +fn bar_strips(side: winrust_common::style::Side, theme: winrust_common::style::Style, autohide: bool, b: RECT, sh: i32) -> (i32, i32) { + use winrust_common::style::{Side, Style}; + if autohide || (theme == Style::Dock && side == Side::Bottom) { return (0, 0); } + if side == Side::Top || (side == Side::Bottom && theme == Style::Tiling) { + (b.bottom.max(0), 0) + } else if side == Side::Bottom { + (0, (sh - b.top).max(0)) + } else { + (0, 0) + } +} + +/// What the bar reserves at the top and bottom of the screen. fn work_strips() -> (i32, i32) { let mut r: RECT = unsafe { std::mem::zeroed() }; if unsafe { SystemParametersInfoW(SPI_GETWORKAREA, 0, &mut r as *mut _ as *mut _, 0) } == 0 { return (0, 0); } - (r.top.max(0), (unsafe { GetSystemMetrics(SM_CYSCREEN) } - r.bottom).max(0)) + let sh = unsafe { GetSystemMetrics(SM_CYSCREEN) }; + let fallback = (r.top.max(0), (sh - r.bottom).max(0)); + let bar = unsafe { FindWindowW(w("topbar").as_ptr(), ptr::null()) }; + if bar.is_null() { return fallback; } + use winrust_common::style; + let mut b: RECT = unsafe { std::mem::zeroed() }; + if unsafe { GetWindowRect(bar, &mut b) } == 0 { return fallback; } + bar_strips(style::side(), style::style(), style::autohide(), b, sh) } /// Margins of the desktop's icon list, from the bar's real size: its reserved strip (any height, top or bottom). /// The dock style reserves nothing but floats over the bottom edge, so it gets a fixed gap while topbar runs. fn desk_top() -> i32 { work_strips().0 + ui::sc(8) } fn desk_bottom() -> i32 { - let reserved = work_strips().1; + let (top, reserved) = work_strips(); if reserved > 0 { return reserved + ui::sc(4); } + if top > 0 { return 0; } // a top bar leaves the bottom edge available for desktop icons let bar_up = unsafe { !FindWindowW(w("topbar").as_ptr(), ptr::null()).is_null() }; if bar_up && winrust_common::style::style() == winrust_common::style::Style::Dock { ui::sc(52) } else { ui::sc(8) } } @@ -409,15 +435,69 @@ fn item_menu(h: HWND, dir: &Path, paths: &[PathBuf]) { /// "Hide desktop icons" is a marker file, so it survives restarts. fn icons_marker() -> PathBuf { PathBuf::from(env::var_os("APPDATA").unwrap_or_default()).join(r"WinRust\desktop-icons-hidden.txt") } fn small_marker() -> PathBuf { icons_marker().with_file_name("small-icons") } -/// Desktop icon size: the system's large (32 px, default) or small (16 px) icons with a tighter grid. Same icon indexes in both. +fn desktop_scale_file() -> PathBuf { icons_marker().with_file_name("desktop-scale.txt") } +fn desktop_scale() -> u32 { + fs::read_to_string(desktop_scale_file()).ok().and_then(|s| s.trim().parse::().ok()) + .filter(|v| [75, 85, 100, 125].contains(v)) + .unwrap_or(if small_marker().exists() { 75 } else { 100 }) +} +/// Fit one more usable row when the remaining desktop height is nearly a full icon cell. +fn desktop_row_spacing(height: i32, desired: i32) -> i32 { + if height <= 0 || desired <= 0 { return desired; } + let rows = (height + desired - 1) / desired; + let fitted = height / rows; + if fitted * 5 >= desired * 4 { fitted } else { desired } +} +fn set_desktop_spacing(list: HWND) -> bool { + let scale = desktop_scale() as i32; + let (cx, desired_cy) = ((88 * scale + 50) / 100, (96 * scale + 50) / 100); + let mut client: RECT = unsafe { std::mem::zeroed() }; + unsafe { GetClientRect(list, &mut client) }; + let height = if client.bottom > 0 { client.bottom } else { (unsafe { GetSystemMetrics(SM_CYSCREEN) }) - desk_top() - desk_bottom() }; + let cy = desktop_row_spacing(height, ui::sc(desired_cy)); + let want = ((cy as isize) << 16) | ui::sc(cx) as isize; + if put(list, LVM_GETITEMSPACING, 0, 0) == want { return false; } + put(list, LVM_SETICONSPACING, 0, want); + true +} +thread_local! { + static DESK_IL: std::cell::Cell = const { std::cell::Cell::new(0) }; + static DESK_FONT: std::cell::Cell = const { std::cell::Cell::new(0) }; + static DESK_ICON_MAP: std::cell::RefCell> = std::cell::RefCell::new(std::collections::HashMap::new()); +} +/// Resize an icon from the shell's system list into the desktop's chosen image list. #[allow(unsafe_op_in_unsafe_fn)] -unsafe fn apply_icon_size(list: HWND) { - let small = small_marker().exists(); +unsafe fn desktop_icon(system_index: i32) -> i32 { + if system_index < 0 { return I_IMAGENONE; } + if let Some(index) = DESK_ICON_MAP.with_borrow(|map| map.get(&system_index).copied()) { return index; } let mut fi: SHFILEINFOW = std::mem::zeroed(); - let il = SHGetFileInfoW(w("C:\\").as_ptr(), 0, &mut fi, size_of::() as u32, SHGFI_SYSICONINDEX | if small { SHGFI_SMALLICON } else { SHGFI_LARGEICON }); + let source = SHGetFileInfoW(w("C:\\").as_ptr(), 0, &mut fi, size_of::() as u32, SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + let icon = ImageList_GetIcon(source as _, system_index, ILD_NORMAL as u32); + if icon.is_null() { return I_IMAGENONE; } + let px = ui::sc((32 * desktop_scale() as i32 + 50) / 100).max(1); + let resized = CopyImage(icon as _, IMAGE_ICON, px, px, 0) as HICON; + let index = ImageList_ReplaceIcon(DESK_IL.get() as _, -1, if resized.is_null() { icon } else { resized }); + if !resized.is_null() { DestroyIcon(resized); } + DestroyIcon(icon); + if index >= 0 { DESK_ICON_MAP.with_borrow_mut(|map| { map.insert(system_index, index); }); } + index +} +/// Change desktop icons, labels, and grid spacing together. The regular file manager keeps its own scale. +#[allow(unsafe_op_in_unsafe_fn)] +unsafe fn apply_icon_size(list: HWND) { + let scale = desktop_scale() as i32; + let px = ui::sc((32 * scale + 50) / 100).max(1); + let il = ImageList_Create(px, px, ILC_COLOR32 | ILC_MASK, 64, 64); + if il == 0 { return; } + let old = DESK_IL.replace(il as isize); + DESK_ICON_MAP.with_borrow_mut(|map| map.clear()); put(list, LVM_SETIMAGELIST, LVSIL_NORMAL as usize, il as isize); - let (cx, cy) = if small { (76, 64) } else { (88, 96) }; - put(list, LVM_SETICONSPACING, 0, ((ui::sc(cy) as isize) << 16) | ui::sc(cx) as isize); + if old != 0 { ImageList_Destroy(old as _); } + set_desktop_spacing(list); + let font = windows_sys::Win32::Graphics::Gdi::CreateFontW(-ui::sc((13 * scale + 50) / 100), 0, 0, 0, 400, 0, 0, 0, 1, 0, 0, 4, 0, w(ui::ui_face()).as_ptr()); + put(list, WM_SETFONT, font as usize, 1); + let old_font = DESK_FONT.replace(font as isize); + if old_font != 0 { windows_sys::Win32::Graphics::Gdi::DeleteObject(old_font as _); } } fn icons_hidden() -> bool { icons_marker().exists() } fn set_icons_hidden(hide: bool) { @@ -454,6 +534,14 @@ unsafe fn bg_menu(h: HWND) { let lbl = if group_on() { t!("Без группировки", "No grouping", ja: "グループ化しない", pt: "Sem agrupamento", zh: "不分组") } else { t!("Группировать по дате", "Group by date", ja: "日付でグループ化", pt: "Agrupar por data", zh: "按日期分组") }; AppendMenuW(m, MF_STRING, 13, w(lbl).as_ptr()); } + if desk() { + let sizes = CreatePopupMenu(); + for (id, size) in [(20usize, 75), (21, 85), (22, 100), (23, 125)] { + let label = format!("{size}%{}", if desktop_scale() == size { " ✓" } else { "" }); + AppendMenuW(sizes, MF_STRING, id, w(&label).as_ptr()); + } + AppendMenuW(m, MF_POPUP, sizes as usize, w(t!("Размер рабочего стола (значки и текст)", "Desktop size (icons and text)", ja: "デスクトップのサイズ (アイコンと文字)", pt: "Tamanho da área de trabalho (ícones e texto)", zh: "桌面大小(图标和文字)")).as_ptr()); + } if desk() { let lbl = if small_marker().exists() { t!("Крупные значки", "Large icons", ja: "大きいアイコン", pt: "Ícones grandes", zh: "大图标") } else { t!("Мелкие значки", "Small icons", ja: "小さいアイコン", pt: "Ícones pequenos", zh: "小图标") }; AppendMenuW(m, MF_STRING, 12, w(lbl).as_ptr()); @@ -473,11 +561,12 @@ unsafe fn bg_menu(h: HWND) { let k = group_marker(); if group_on() { let _ = fs::remove_file(&k); } else { if let Some(d) = k.parent() { let _ = fs::create_dir_all(d); } let _ = fs::write(&k, "1"); } } - 12 => { // the grid changes with the size: icons are laid out again - let k = small_marker(); - if k.exists() { let _ = fs::remove_file(&k); } else { let _ = fs::write(&k, "1"); } + 20..=23 => { // keep the saved icon positions, mapped to the new grid + let size = [75, 85, 100, 125][id as usize - 20]; + let k = desktop_scale_file(); + if let Some(parent) = k.parent() { let _ = fs::create_dir_all(parent); } + let _ = fs::write(k, size.to_string()); apply_icon_size(ST.with_borrow(|st| st.list)); - let _ = fs::remove_file(desk::pos_file()); } 8..=11 => { // the saved cells are dropped: reload lays every icon out again, down the columns in sort order if id != 11 { SORT_COL.store([0, 1, 3][id as usize - 8], Relaxed); SORT_ASC.store(true, Relaxed); } @@ -1551,9 +1640,6 @@ unsafe extern "system" fn proc(h: HWND, m: u32, wp: WPARAM, lp: LPARAM) -> LRESU let il = SHGetFileInfoW(w("C:\\").as_ptr(), 0, &mut fi, size_of::() as u32, SHGFI_SYSICONINDEX | SHGFI_SMALLICON); put(list, LVM_SETIMAGELIST, LVSIL_SMALL as usize, il as isize); if desk() { - // system large icons; indexes are shared with the small list, so icon_of() works unchanged - let big = SHGetFileInfoW(w("C:\\").as_ptr(), 0, &mut fi, size_of::() as u32, SHGFI_SYSICONINDEX | SHGFI_LARGEICON); - put(list, LVM_SETIMAGELIST, LVSIL_NORMAL as usize, big as isize); apply_icon_size(list); // transparent background (the desktop paints it) and shadowed labels, readable on light wallpapers too let ex = LVS_EX_TRANSPARENTBKGND | 0x0080_0000; // LVS_EX_TRANSPARENTSHADOWTEXT @@ -1562,7 +1648,6 @@ unsafe extern "system" fn proc(h: HWND, m: u32, wp: WPARAM, lp: LPARAM) -> LRESU put(list, LVM_SETTEXTCOLOR, 0, 0x00FF_FFFF); reload_wall(); // grey (not ClearType) smoothing: on a live wallpaper the labels sit on a colour key, where ClearType leaves coloured fringes - put(list, WM_SETFONT, windows_sys::Win32::Graphics::Gdi::CreateFontW(-ui::sc(13), 0, 0, 0, 400, 0, 0, 0, 1, 0, 0, 4, 0, w(ui::ui_face()).as_ptr()) as usize, 1); // like explorer's desktop: wallpaper apps look for a SHELLDLL_DefView under Progman CreateWindowExW(0, w("SHELLDLL_DefView").as_ptr(), ptr::null(), WS_CHILD, 0, 0, 0, 0, h, 0 as _, inst, ptr::null()); SetTimer(h, 7, 2000, None); // live wallpaper on / off (desk::check_live) @@ -1708,7 +1793,7 @@ unsafe extern "system" fn proc(h: HWND, m: u32, wp: WPARAM, lp: LPARAM) -> LRESU it.iImage = if r.thumb >= 0 { r.thumb } else { I_IMAGENONE }; } else if it.mask & LVIF_IMAGE != 0 { if r.icon < 0 { r.icon = icon_of(&dir.join(&r.name), r.dir); } - it.iImage = r.icon; + it.iImage = if desk() { desktop_icon(r.icon) } else { r.icon }; } }); } @@ -1870,7 +1955,13 @@ unsafe extern "system" fn proc(h: HWND, m: u32, wp: WPARAM, lp: LPARAM) -> LRESU // a secondary monitor, where the list does not reach (#125) WM_CONTEXTMENU if desk() && (icons_hidden() || wp as HWND == h) => { bg_menu(h); 0 } desk::SPAWN_WORKERW if desk() => { desk::spawn_workerw(h); 0 } - WM_TIMER if desk() && wp == 7 => { desk::check_live(ST.with_borrow(|st| st.list)); 0 } + WM_TIMER if desk() && wp == 7 => { + let list = ST.with_borrow(|st| st.list); + place_desk_list(list); // catches a bar move even if the work-area broadcast was missed + if set_desktop_spacing(list) { reload(h); } + desk::check_live(list); + 0 + } WM_DESTROY => { if !desk() { save_place(h); } shellwin::revoke(); PostQuitMessage(0); 0 } _ => DefWindowProcW(h, m, wp, lp), } @@ -1965,6 +2056,45 @@ fn main() { #[cfg(test)] mod tests { + #[test] + fn desktop_grid_reaches_the_bottom_row() { + let cy = super::desktop_row_spacing(1038, 82); + assert_eq!(cy, 79); + assert_eq!(1038 / cy, 13); + assert_eq!(super::desktop_row_spacing(120, 96), 96); // do not squeeze short views excessively + } + + #[test] + fn desktop_icons_render_in_a_custom_size_list() { + unsafe { + let _ = super::InitCommonControlsEx(&super::INITCOMMONCONTROLSEX { + dwSize: std::mem::size_of::() as u32, + dwICC: super::ICC_LISTVIEW_CLASSES, + }); + let list = super::ImageList_Create(27, 27, super::ILC_COLOR32 | super::ILC_MASK, 1, 1); + assert_ne!(list, 0); + super::DESK_IL.set(list as isize); + let index = super::desktop_icon(0); + assert!(index >= 0); + let icon = super::ImageList_GetIcon(list, index, super::ILD_NORMAL as u32); + assert!(!icon.is_null()); + super::DestroyIcon(icon); + super::ImageList_Destroy(list); + super::DESK_IL.set(0); + } + } + + #[test] + fn desktop_follows_the_bars_current_edge() { + use winrust_common::style::{Side, Style}; + let top = super::RECT { left: 0, top: 0, right: 1920, bottom: 34 }; + let bottom = super::RECT { left: 0, top: 1046, right: 1920, bottom: 1080 }; + assert_eq!(super::bar_strips(Side::Top, Style::Normal, false, top, 1080), (34, 0)); + assert_eq!(super::bar_strips(Side::Bottom, Style::Normal, false, bottom, 1080), (0, 34)); + assert_eq!(super::bar_strips(Side::Bottom, Style::Tiling, false, top, 1080), (34, 0)); + assert_eq!(super::bar_strips(Side::Top, Style::Normal, true, top, 1080), (0, 0)); + } + #[test] fn window_place_parses_and_rejects_junk() { let (max, r) = super::parse_place("max 10 20 1010 680").unwrap(); diff --git a/plugins/topbar/src/main.rs b/plugins/topbar/src/main.rs index e1efe5e..60dbef7 100644 --- a/plugins/topbar/src/main.rs +++ b/plugins/topbar/src/main.rs @@ -1,4 +1,4 @@ -// topbar: replaces the Windows taskbar with a panel at the bottom of the screen (the name stayed from when it sat on top), +// topbar: replaces the Windows taskbar with a panel on the chosen screen edge, // drawn in the Windows 11 taskbar palette: Start, pinned apps and open windows in the center; tray apps, language, wifi, // volume, battery and date/time on the right. `--restore` brings the normal taskbar back (used by uninstall). #![windows_subsystem = "windows"] @@ -64,17 +64,17 @@ use windows_sys::Win32::{ fn rr(v: i32) -> i32 { if style().square() { 0 } else { sc(v) } } -/// The bar sits at the top of the screen (tiling) instead of the bottom. +/// The bar sits at the top of the screen (by position setting or tiling theme). fn at_top() -> bool { - style() == Style::Tiling && !vert() + !vert() && (i18n::style::side() == i18n::style::Side::Top || style() == Style::Tiling) } /// The bar stands on the left or right edge of the screen (its "width" is bar_h(), it spans the screen height). fn vert() -> bool { - i18n::style::side() != i18n::style::Side::Bottom + matches!(i18n::style::side(), i18n::style::Side::Left | i18n::style::Side::Right) } -/// The floating dock (a pill in the middle of the bottom edge); a side bar is never a dock. +/// The floating dock (a pill in the middle of the bottom edge). fn dock() -> bool { - style() == Style::Dock && !vert() + style() == Style::Dock && i18n::style::side() == i18n::style::Side::Bottom } /// Screen x of a side bar's current left edge, slid away by the show/hide animation. unsafe fn bar_x() -> i32 { @@ -147,6 +147,7 @@ static BAR: AtomicIsize = AtomicIsize::new(0); // the bar window, for the hook t const WIN_NUM: u32 = WM_APP + 15; // posted by the keyboard hook: Win+1..9 (wp 0..8) = the n-th button of the bar const WIN_X: u32 = WM_APP + 17; // posted by the keyboard hook: Win+X = our power-user menu (start_menu) const NEXT_LANG: u32 = WM_APP + 16; // posted by the keyboard hook: Win+Space with no explorer (wp 1 = Shift held: previous layout) +const TILE_WINDOWS: u32 = WM_APP + 18; // posted by the keyboard hook: Ctrl+Alt+T const VOLKEY: u32 = WM_APP + 14; // posted by the keyboard hook: a volume key (wp 0 up, 1 down, 2 mute) const SNIP: u32 = WM_APP + 13; // posted by the keyboard hook: PrtSc / Win+Shift+S with no explorer to handle them static EXPLORER_UP: AtomicBool = AtomicBool::new(true); // explorer's taskbar exists (it handles PrtSc itself then); refreshed by the bar @@ -248,6 +249,7 @@ thread_local! { static FLASH: RefCell> = const { RefCell::new(Vec::new()) }; // windows asking for attention (FlashWindowEx) until activated (#129) static APP_FG: Cell = const { Cell::new(null_mut()) }; // last foreground window that is not ours: the language button acts on it static LANG_TRY: Cell<(u32, usize, usize)> = const { Cell::new((0, 0, 0)) }; // (thread, layout before, layout asked for) of the last switch, checked by timer 7 + static BAR_WORK: Cell<(i32, i32, i32, i32)> = const { Cell::new((-1, -1, -1, -1)) }; // last work area reserved by place() } fn wide(s: &str) -> Vec { @@ -256,11 +258,15 @@ fn wide(s: &str) -> Vec { fn sc(v: i32) -> i32 { (v as f32 * SCALE.get()) as i32 } +/// Taskbar symbols use the chosen size; slots and hit targets stay unchanged. +fn icon_sc(v: i32) -> i32 { + sc((v as f32 * i18n::style::icon_size() as f32 / 100.0).round() as i32).max(1) +} fn bar_h() -> i32 { let d = [-6, 0, 8][i18n::style::bar_size() as usize % 3]; // small / normal / large if vert() { sc(60 + d) } else { sc(BAR_H + d) } } -/// Screen y of the bar's top edge when it is in place (bottom of the primary monitor, or its top in the tiling style). +/// Screen y of the bar's top edge when it is in place. unsafe fn bar_top() -> i32 { if at_top() { 0 } else { GetSystemMetrics(SM_CYSCREEN) - bar_h() - dock_gap() } } @@ -712,7 +718,7 @@ unsafe fn hide_taskbar_if_shown() { } } -/// Reserves the bottom strip of the primary monitor (maximized windows stay above it). +/// Reserves a strip on the bar's screen edge so maximized windows stay clear of it. unsafe fn place(hwnd: HWND) { apply_opacity(hwnd); let (cx, cy) = (GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); @@ -746,9 +752,9 @@ unsafe fn place(hwnd: HWND) { // No explorer (rs-shell / rust-explorer): nobody handles appbars, so set the work area ourselves. Without it maximized // windows slide under the bar and, covering the whole monitor, count as "fullscreen" and hide the bar. // Also with Explorer: it does not always honour the appbar when its own taskbar is hidden (#89). - { - set_work_area(if vert() { if ab.uEdge == ABE_LEFT { RECT { left: ab.rc.right, top: 0, right: cx, bottom: cy } } else { RECT { left: 0, top: 0, right: ab.rc.left, bottom: cy } } } else if at_top() { RECT { left: 0, top: ab.rc.bottom, right: cx, bottom: cy } } else { RECT { left: 0, top: 0, right: cx, bottom: ab.rc.top } }); - } + let work = if vert() { if ab.uEdge == ABE_LEFT { RECT { left: ab.rc.right, top: 0, right: cx, bottom: cy } } else { RECT { left: 0, top: 0, right: ab.rc.left, bottom: cy } } } else if at_top() { RECT { left: 0, top: ab.rc.bottom, right: cx, bottom: cy } } else { RECT { left: 0, top: 0, right: cx, bottom: ab.rc.top } }; + BAR_WORK.set((work.left, work.top, work.right, work.bottom)); + set_work_area(work); let (x, w) = bar_x_w(); // the dock is a pill; the other styles a plain strip SetWindowRgn(hwnd, if dock() { CreateRoundRectRgn(0, 0, w + 1, bar_h() + 1, bar_h(), bar_h()) } else { null_mut() }, 1); @@ -778,6 +784,15 @@ unsafe fn set_work_area(mut want: RECT) { } } +/// Explorer and display changes can reset the work area after the bar has already claimed its edge. +unsafe fn work_area_drifted() -> bool { + let want = BAR_WORK.get(); + if want.0 < 0 { return false; } + let mut current: RECT = zeroed(); + SystemParametersInfoW(SPI_GETWORKAREA, 0, &mut current as *mut _ as *mut _, 0) != 0 + && (current.left, current.top, current.right, current.bottom) != want +} + /// A window that was already maximized keeps its old height when the work area shrinks: trim it (size only, no restore). unsafe extern "system" fn fit_maximized(h: HWND, lp: isize) -> i32 { let want = &*(lp as *const RECT); @@ -906,10 +921,10 @@ unsafe fn lnk_icon(lnk: &[u16], target: &str) -> HICON { icon } -/// Size app icons are drawn at (24 logical px, like the Windows 11 taskbar). Icons are loaded at exactly this size: +/// Size app icons are drawn at. Icons are loaded at exactly this size: /// a 32 px icon stretched by DrawIconEx comes out jagged. fn icon_px() -> i32 { - sc(24) + icon_sc(24) } /// Icon of a file, shortcut (its target's icon, no arrow) or shell item ("shell:AppsFolder\") rendered by the @@ -935,6 +950,24 @@ thread_local! { static EXE_ICONS: RefCell> = RefCell::new(HashMap::new()); // crisp icons of running apps, by exe } +/// Recreate cached app icons after the size changes so they remain crisp. +unsafe fn reload_icons() { + PINS.with_borrow_mut(|pins| { + for pin in pins.iter_mut() { + let icon = lnk_icon(&pin.lnk, &pin.target); + if !pin.icon.is_null() { DestroyIcon(pin.icon); } + pin.icon = icon; + } + }); + EXE_ICONS.with_borrow_mut(|icons| { + for icon in icons.values() { + if !icon.is_null() { DestroyIcon(*icon); } + } + icons.clear(); + }); + refresh_buttons(); +} + /// Icon of a running window for its bar button: its exe's icon at the exact size (cached), else what the window reports. /// Apps run by a generic host (Store apps in ApplicationFrameHost, Java games in javaw, scripts in python...) would all /// get the host's icon: those keep the window's own icon. @@ -1771,7 +1804,7 @@ unsafe fn paint_vert(dc: HDC, cr: RECT, fonts: [HFONT; 4]) { fill(dc, r, mix(pal().bg, pal().accent, 0.4), sc(8)); } if i == 0 { - let t = ((sc(8) as f32) * (1.0 + 0.12 * th) * (1.0 - 0.2 * tp)) as i32; + let t = ((icon_sc(8) as f32) * (1.0 + 0.12 * th) * (1.0 - 0.2 * tp)) as i32; let g = sc(1).max(1); let tint = [mix(pal().accent, pal().text, 0.35), mix(pal().accent, pal().text, 0.15), mix(pal().accent, pal().text, 0.15), pal().accent]; for (k, (dx, dy)) in [(-1, -1), (0, -1), (-1, 0), (0, 0)].into_iter().enumerate() { @@ -1805,7 +1838,7 @@ unsafe fn paint_vert(dc: HDC, cr: RECT, fonts: [HFONT; 4]) { glow(dc, TAPP, hot == TAPP, cell(l.apps.0, sc(24)), pal().bg, pal().hover, sc(8)); let turn = ease(hv(TF_KEY, IsWindowVisible(TRAYFLY.get()) != 0)); - chevron(dc, cx, l.apps.0 + sc(12), sc(5), if left { 90.0 } else { 270.0 } + 180.0 * turn, mix(pal().text, pal().accent, turn)); + chevron(dc, cx, l.apps.0 + sc(12), icon_sc(5), if left { 90.0 } else { 270.0 } + 180.0 * turn, mix(pal().text, pal().accent, turn)); SelectObject(dc, f_txt); let bar = bar_idx(); TAPPS.with_borrow(|t| { @@ -1814,7 +1847,8 @@ unsafe fn paint_vert(dc: HDC, cr: RECT, fonts: [HFONT; 4]) { let y = l.apps.0 + i as i32 * sc(24); glow(dc, TAPP + i as i32, hot == TAPP + i as i32, cell(y, sc(24)), pal().bg, pal().hover, sc(8)); if !ti.icon.is_null() { - DrawIconEx(dc, cx - sc(8), y + sc(4), ti.icon, sc(16), sc(16), 0, null_mut(), DI_NORMAL); + let size = icon_sc(16); + DrawIconEx(dc, cx - size / 2, y + (sc(24) - size) / 2, ti.icon, size, size, 0, null_mut(), DI_NORMAL); } } }); @@ -1826,7 +1860,7 @@ unsafe fn paint_vert(dc: HDC, cr: RECT, fonts: [HFONT; 4]) { fill(dc, grp, mix(mix(pal().bg, pal().hover, tg), pal().accent, 0.5 * pg), sc(8)); } text(dc, &lang_name(), cell(l.sys.0, sc(42)), pal().text, DT_CENTER); - net_icon(dc, cx, l.sys.0 + sc(58), sc(17), f_glyph); + net_icon(dc, cx, l.sys.0 + sc(58), icon_sc(17), f_glyph); SelectObject(dc, f_glyph); let (vol, muted) = VOL.get(); let vg = if muted || vol == 0 { "\u{E74F}" } else if vol < 34 { "\u{E993}" } else if vol < 67 { "\u{E994}" } else { "\u{E995}" }; @@ -1834,7 +1868,7 @@ unsafe fn paint_vert(dc: HDC, cr: RECT, fonts: [HFONT; 4]) { let (pct, ac) = BAT.get(); if pct >= 0 { let col = if ac { GOOD } else if pct <= 15 { BAD } else { pal().text }; - let (bw, bh) = (sc(22), sc(11)); + let (bw, bh) = (icon_sc(22), icon_sc(11)); let (bx, by) = (cx - bw / 2 - sc(1), l.sys.0 + sc(111)); fill(dc, RECT { left: bx, top: by, right: bx + bw, bottom: by + bh }, col, sc(4)); fill(dc, RECT { left: bx + sc(1), top: by + sc(1), right: bx + bw - sc(1), bottom: by + bh - sc(1) }, mix(pal().bg, pal().hover, tg), sc(3)); @@ -1922,7 +1956,8 @@ unsafe fn bar_fonts() -> [HFONT; 4] { }); let (face, gface) = (wide(ui_face()), wide(winrust_common::style::icon_face())); let font = |f: &[u16], px: i32, wt: i32| CreateFontW(-sc(px), 0, 0, 0, wt, 0, 0, 0, 1, 0, 0, 5, 0, f.as_ptr()); - let fonts = [font(&face, 13, 400), font(&face, 12, 400), font(&gface, 16, 400), font(&face, 13, 600)]; + let icon_px = (16.0 * i18n::style::icon_size() as f32 / 100.0).round() as i32; + let fonts = [font(&face, 13, 400), font(&face, 12, 400), font(&gface, icon_px, 400), font(&face, 13, 600)]; FONTS.set((fonts, key)); fonts } @@ -1987,7 +2022,7 @@ unsafe fn paint(hwnd: HWND) { } if i == 0 { // Windows logo in four tiles, lit from the top left; grows a little on hover, squeezes on click - let t = ((sc(8) as f32) * (1.0 + 0.12 * th) * (1.0 - 0.2 * tp)) as i32; + let t = ((icon_sc(8) as f32) * (1.0 + 0.12 * th) * (1.0 - 0.2 * tp)) as i32; let (g, cx) = (sc(1).max(1), (r.left + r.right) / 2); let tint = [mix(pal().accent, pal().text, 0.35), mix(pal().accent, pal().text, 0.15), mix(pal().accent, pal().text, 0.15), pal().accent]; for (k, (dx, dy)) in [(-1, -1), (0, -1), (-1, 0), (0, 0)].into_iter().enumerate() { @@ -2030,7 +2065,7 @@ unsafe fn paint(hwnd: HWND) { let open_tf = IsWindowVisible(TRAYFLY.get()) != 0; let turn = ease(hv(TF_KEY, open_tf)); // the chevron turns over as the flyout opens, and back let cc = cell(l.apps.0, sc(24)); - chevron(dc, (cc.left + cc.right) / 2, mid, sc(5), if at_top() { 180.0 } else { 0.0 } + 180.0 * turn, mix(pal().text, pal().accent, turn)); + chevron(dc, (cc.left + cc.right) / 2, mid, icon_sc(5), if at_top() { 180.0 } else { 0.0 } + 180.0 * turn, mix(pal().text, pal().accent, turn)); SelectObject(dc, f_txt); let bar = bar_idx(); TAPPS.with_borrow(|t| { @@ -2039,7 +2074,8 @@ unsafe fn paint(hwnd: HWND) { let x = l.apps.0 + i as i32 * sc(24); glow(dc, TAPP + i as i32, hot == TAPP + i as i32, cell(x, sc(24)), pal().bg, pal().hover, sc(8)); if !ti.icon.is_null() { - DrawIconEx(dc, x + sc(4), mid - sc(8), ti.icon, sc(16), sc(16), 0, null_mut(), DI_NORMAL); + let size = icon_sc(16); + DrawIconEx(dc, x + (sc(24) - size) / 2, mid - size / 2, ti.icon, size, size, 0, null_mut(), DI_NORMAL); } } }); @@ -2055,7 +2091,7 @@ unsafe fn paint(hwnd: HWND) { let mut x = tb.left + sc(10); text(dc, &lang_name(), cell(x, sc(34)), pal().text, DT_LEFT); x += sc(42); - net_icon(dc, x + sc(9), mid, sc(17), f_glyph); + net_icon(dc, x + sc(9), mid, icon_sc(17), f_glyph); x += sc(32); SelectObject(dc, f_glyph); let (vol, muted) = VOL.get(); @@ -2065,7 +2101,8 @@ unsafe fn paint(hwnd: HWND) { let (pct, ac) = BAT.get(); if pct >= 0 { let col = if ac { GOOD } else if pct <= 15 { BAD } else { pal().text }; - let (bw, bh, by) = (sc(22), sc(11), mid - sc(5)); + let (bw, bh) = (icon_sc(22), icon_sc(11)); + let by = mid - bh / 2; fill(dc, RECT { left: x, top: by, right: x + bw, bottom: by + bh }, col, sc(4)); // outline fill(dc, RECT { left: x + sc(1), top: by + sc(1), right: x + bw - sc(1), bottom: by + bh - sc(1) }, mix(pal().bg, pal().hover, tg), sc(3)); let fw = ((bw - sc(4)) * pct / 100).max(sc(1)); @@ -2814,6 +2851,7 @@ unsafe extern "system" fn wndproc(hwnd: HWND, msg: u32, wp: WPARAM, lp: LPARAM) WIN_NUM => win_num(wp), WIN_X => start_menu(), NEXT_LANG => next_lang(hwnd, wp == 1), + TILE_WINDOWS => tile_windows(), ALT_UP if wp == 2 => alt_close(), ALT_UP => alt_done(wp == 1), SNIP if wp == 1 => screenshot_notice(hwnd), @@ -2837,6 +2875,7 @@ unsafe extern "system" fn wndproc(hwnd: HWND, msg: u32, wp: WPARAM, lp: LPARAM) } WM_TIMER => { hide_taskbar_if_shown(); + if work_area_drifted() { place(hwnd); } refresh_status(); if TICK.get() % 5 == 0 { refresh_windows(); // safety net for a window event the hook did not report @@ -2897,6 +2936,9 @@ unsafe extern "system" fn wndproc(hwnd: HWND, msg: u32, wp: WPARAM, lp: LPARAM) } } WM_DISPLAYCHANGE => place(hwnd), + WM_SETTINGCHANGE if wp == SPI_SETWORKAREA as usize => { + if work_area_drifted() { place(hwnd); } + } WM_DESTROY => { let mut ab: APPBARDATA = zeroed(); ab.cbSize = size_of::() as u32; diff --git a/plugins/topbar/src/run.rs b/plugins/topbar/src/run.rs index 63a27c3..cd25516 100644 --- a/plugins/topbar/src/run.rs +++ b/plugins/topbar/src/run.rs @@ -1,6 +1,8 @@ //! topbar: run (split out of main.rs; shares its items through `super::*`). use super::*; +static TILE_KEY_DOWN: AtomicBool = AtomicBool::new(false); + /// The Windows "Run" box. `rundll32 shell32.dll,#61` cannot do it: ordinal 61 is RunFileDlg(hwnd, icon, dir, title, /// prompt, flags) and rundll32 passes other arguments. Its own thread: the box runs a modal loop until closed. pub(crate) fn run_dialog() { @@ -53,6 +55,17 @@ pub(crate) unsafe extern "system" fn kb_hook(n: i32, w: WPARAM, l: LPARAM) -> LR // Win+Shift+S is our own region clipper (also under Explorer); without explorer nobody opens the screen // capture either: PrtSc (when Windows is set to snip with it; otherwise it copies the screen by itself) does it here let held = |vk: u16| GetAsyncKeyState(vk as i32) < 0; + // Ctrl+Alt+T runs the same tiling action as the gear menu, once per key press. + if k.vkCode == b'T' as u32 { + if !down0 { + if TILE_KEY_DOWN.swap(false, Relaxed) { return 1; } + } else if held(VK_CONTROL) && held(VK_MENU) && !held(VK_SHIFT) && !held(VK_LWIN) && !held(VK_RWIN) { + if !TILE_KEY_DOWN.swap(true, Relaxed) { + PostMessageW(BAR.load(Relaxed) as HWND, TILE_WINDOWS, 0, 0); + } + return 1; + } + } let snip_key = !EXPLORER_UP.load(Relaxed) && k.vkCode == VK_SNAPSHOT as u32; let win_shift_s = k.vkCode == b'S' as u32 && down0 && (held(VK_LWIN) || held(VK_RWIN)) && held(VK_SHIFT); if snip_key || win_shift_s { diff --git a/plugins/topbar/src/settings.rs b/plugins/topbar/src/settings.rs index a66c420..e0af3cc 100644 --- a/plugins/topbar/src/settings.rs +++ b/plugins/topbar/src/settings.rs @@ -12,7 +12,7 @@ pub(crate) unsafe fn style_menu() { fly::MItem::new(t!("Язык", "Language", ja: "言語", pt: "Idioma", zh: "语言")).hint(i18n::lang().name()), fly::MItem::head(t!("Панель", "Bar", ja: "バー", pt: "Barra", zh: "任务栏")).sep(), fly::MItem::new(t!("Положение, размер, поведение", "Position, size, behavior", ja: "位置、サイズ、動作", pt: "Posição, tamanho, comportamento", zh: "位置、大小、行为")).hint("›"), - fly::MItem::new(t!("Разложить окна плиткой", "Tile the windows", ja: "ウィンドウを並べて表示", pt: "Lado a lado", zh: "平铺窗口")), + fly::MItem::new(t!("Разложить окна плиткой", "Tile the windows", ja: "ウィンドウを並べて表示", pt: "Lado a lado", zh: "平铺窗口")).hint("Ctrl+Alt+T"), fly::MItem::new(t!("Сбросить всё по умолчанию…", "Reset everything to defaults…", ja: "すべて初期設定に戻す…", pt: "Restaurar tudo ao padrão…", zh: "将所有设置恢复默认…")).danger().sep(), ]; gear_page("\u{E713}", t!("Настройки панели", "Bar settings", ja: "バーの設定", pt: "Configurações da barra", zh: "任务栏设置"), t!("Вид панели и программ WinRust", "Look of the bar and the WinRust programs", ja: "バーと WinRust プログラムの外観", pt: "Aparência da barra e dos programas da WinRust", zh: "任务栏与 WinRust 程序的外观"), items, |i| match i { @@ -94,17 +94,19 @@ pub(crate) unsafe fn theme_page() { pub(crate) unsafe fn bar_page() { use i18n::style::{self as st, Side}; - let sides = [Side::Bottom, Side::Left, Side::Right]; + let sides = [Side::Bottom, Side::Top, Side::Left, Side::Right]; let items = vec![ back(), fly::MItem::head(t!("Положение", "Position", ja: "位置", pt: "Posição", zh: "位置")).sep(), fly::MItem::new(t!("Снизу", "Bottom", ja: "下", pt: "Embaixo", zh: "底部")).on(st::side() == Side::Bottom), + fly::MItem::new(t!("Сверху", "Top", ja: "上", pt: "Em cima", zh: "顶部")).on(st::side() == Side::Top), fly::MItem::new(t!("Слева", "Left", ja: "左", pt: "Esquerda", zh: "左侧")).on(st::side() == Side::Left), fly::MItem::new(t!("Справа", "Right", ja: "右", pt: "Direita", zh: "右侧")).on(st::side() == Side::Right), fly::MItem::head(t!("Размер", "Size", ja: "サイズ", pt: "Tamanho", zh: "大小")), fly::MItem::new(t!("Маленькая", "Small", ja: "小", pt: "Pequeno", zh: "小")).on(st::bar_size() == 0), fly::MItem::new(t!("Обычная", "Normal", ja: "通常", pt: "Normal", zh: "正常")).on(st::bar_size() == 1), fly::MItem::new(t!("Большая", "Large", ja: "大", pt: "Grande", zh: "大")).on(st::bar_size() == 2), + fly::MItem::new(format!("{} ({} %)", t!("Размер значков", "Icon size", ja: "アイコンのサイズ", pt: "Tamanho dos ícones", zh: "图标大小"), st::icon_size())).hint("›"), fly::MItem::head(t!("Поведение", "Behavior", ja: "動作", pt: "Comportamento", zh: "行为")), fly::MItem::new(t!("Скрывать автоматически", "Hide automatically", ja: "自動的に隠す", pt: "Ocultar automaticamente", zh: "自动隐藏")).on(st::autohide()), fly::MItem::new(t!("Кнопки слева, как в Windows 10", "Buttons on the left, like Windows 10", ja: "ボタンを左に配置 (Windows 10 風)", pt: "Botões à esquerda, como no Windows 10", zh: "按钮靠左,如同 Windows 10")).on(st::align_left()), @@ -112,18 +114,33 @@ pub(crate) unsafe fn bar_page() { ]; gear_page("\u{E8A1}", t!("Панель", "Bar", ja: "バー", pt: "Barra", zh: "任务栏"), t!("Где она, какого размера и как себя ведёт", "Where it sits, its size and behavior", ja: "配置場所、サイズ、動作", pt: "Onde fica, seu tamanho e comportamento", zh: "其位置、大小和行为"), items, move |i| { match i { - 2..=4 => st::set_side(sides[i - 2]), - 6..=8 => st::set_bar_size((i - 6) as u8), - 10 => st::set_autohide(!st::autohide()), // the reserved strip comes or goes with it - 11 => st::set_align_left(!st::align_left()), - 12 => st::set_alttab_per_monitor(!st::alttab_per_monitor()), + 2..=5 => st::set_side(sides[i - 2]), + 7..=9 => st::set_bar_size((i - 7) as u8), + 10 => return icon_size_page(), + 12 => st::set_autohide(!st::autohide()), // the reserved strip comes or goes with it + 13 => st::set_align_left(!st::align_left()), + 14 => st::set_alttab_per_monitor(!st::alttab_per_monitor()), _ => return style_menu(), } - relook(i != 12); + relook(i != 14); bar_page(); }); } +pub(crate) unsafe fn icon_size_page() { + use i18n::style as st; + const SIZES: [u8; 6] = [50, 60, 70, 80, 90, 100]; + let mut items = vec![back(), fly::MItem::head(t!("Размер значков", "Icon size", ja: "アイコンのサイズ", pt: "Tamanho dos ícones")).sep()]; + items.extend(SIZES.iter().map(|&size| fly::MItem::new(format!("{size} %")).on(st::icon_size() == size))); + gear_page("\u{E8A1}", t!("Размер значков", "Icon size", ja: "アイコンのサイズ", pt: "Tamanho dos ícones"), t!("Размер значков на панели", "Size of icons on the bar", ja: "バーのアイコンサイズ", pt: "Tamanho dos ícones na barra"), items, move |i| { + let Some(&size) = i.checked_sub(2).and_then(|n| SIZES.get(n)) else { return bar_page() }; + st::set_icon_size(size); + reload_icons(); + relook(false); + icon_size_page(); + }); +} + /// Bar transparency from the colours page (the window is layered; 100 % = opaque). pub(crate) unsafe fn apply_opacity(hwnd: HWND) { SetLayeredWindowAttributes(hwnd, 0, (255 * i18n::style::bar_opacity() as u32 / 100) as u8, LWA_ALPHA);