buninu-browser 0.2.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/jsmdcui.txt +22 -0
- package/README.md +102 -2
- package/frontends/wayland/LICENSE-land +21 -0
- package/frontends/wayland/README.md +123 -0
- package/frontends/wayland/casty/LICENSE +21 -0
- package/frontends/wayland/casty/bookmarks.js +32 -0
- package/frontends/wayland/casty/click.js +96 -0
- package/frontends/wayland/casty/commands.js +61 -0
- package/frontends/wayland/casty/config.js +45 -0
- package/frontends/wayland/casty/download-directory.js +28 -0
- package/frontends/wayland/casty/download.js +49 -0
- package/frontends/wayland/casty/hints.js +334 -0
- package/frontends/wayland/casty/keys.js +56 -0
- package/frontends/wayland/casty/page-commands.js +80 -0
- package/frontends/wayland/casty/prompt-width.js +148 -0
- package/frontends/wayland/casty/urlbar.js +606 -0
- package/frontends/wayland/client.js +88 -0
- package/frontends/wayland/clipboard.js +80 -0
- package/frontends/wayland/index.js +116 -0
- package/frontends/wayland/input.js +56 -0
- package/frontends/wayland/protocol.js +55 -0
- package/frontends/wayland/protocols/wayland.xml +3248 -0
- package/frontends/wayland/protocols/xdg-shell.xml +1415 -0
- package/frontends/wayland/transport.js +120 -0
- package/frontends/wayland/urlbar.js +158 -0
- package/index.js +28 -1
- package/lib/clipboard-command.js +10 -0
- package/lib/clipboard-powershell.js +22 -0
- package/lib/clipboard.js +57 -0
- package/lib/document-types.js +11 -0
- package/lib/headless-shell.js +78 -13
- package/lib/layout/text-layout.js +17 -9
- package/lib/paint/display-list.js +5 -1
- package/lib/paint/frame.js +35 -3
- package/lib/paint/raw-frames.js +47 -0
- package/lib/qml/README.md +971 -0
- package/lib/qml/builtins.js +700 -0
- package/lib/qml/canvas-dom.js +115 -0
- package/lib/qml/document.js +1176 -0
- package/lib/qml/format.js +9 -0
- package/lib/qml/host.js +324 -0
- package/lib/qml/images.js +199 -0
- package/lib/qml/launcher.js +132 -0
- package/lib/qml/loader.js +517 -0
- package/lib/qml/media-renderer.js +49 -0
- package/lib/qml/media.js +86 -0
- package/lib/qml/models.js +622 -0
- package/lib/qml/parser.js +381 -0
- package/lib/qml/qs +5 -0
- package/lib/qml/qscasty +3 -0
- package/lib/qml/qsheadless +3 -0
- package/lib/qml/qswayland +3 -0
- package/lib/qml/reactive.js +159 -0
- package/lib/qml/runtime.js +3381 -0
- package/lib/qml/shapes.js +243 -0
- package/lib/qml/text.js +109 -0
- package/lib/qml/textures.js +123 -0
- package/lib/qml/wayland-clipboard.js +32 -0
- package/lib/qml/worker-thread.js +70 -0
- package/lib/render-tree/index.js +16 -1
- package/lib/renderer/bindings.js +11 -0
- package/lib/renderer/canvas-2d.js +13 -0
- package/lib/renderer/compositor-channel.js +103 -0
- package/lib/renderer/compositor.js +25 -33
- package/lib/renderer/flags.js +1 -1
- package/lib/renderer/host.js +128 -92
- package/lib/renderer/main.js +38 -4
- package/lib/renderer/page-realm.js +32 -1
- package/lib/renderer/page-renderer.js +250 -21
- package/lib/renderer/text-input-paint.js +54 -0
- package/lib/renderer/text-input.js +57 -0
- package/lib/style/computed-style.js +2 -2
- package/package.json +1 -1
- package/test/clipboard.test.js +54 -0
- package/test/fixtures/browser-raw-demo.html +36 -0
- package/test/fixtures/flea-helpers/Dockerfile +36 -0
- package/test/fixtures/flea-helpers/bat.mjs +43 -0
- package/test/fixtures/flea-helpers/bin/bat +3 -0
- package/test/fixtures/flea-helpers/bin/bwrap +10 -0
- package/test/fixtures/flea-helpers/bin/bwrap-real-filter +9 -0
- package/test/fixtures/flea-helpers/bin/glow +3 -0
- package/test/fixtures/flea-helpers/bin/qs +3 -0
- package/test/fixtures/flea-helpers/bin/unsupported +3 -0
- package/test/fixtures/flea-helpers/check-highlighting.mjs +47 -0
- package/test/fixtures/flea-helpers/check-media.mjs +29 -0
- package/test/fixtures/flea-helpers/check-preview.mjs +27 -0
- package/test/fixtures/flea-helpers/check.mjs +36 -0
- package/test/fixtures/flea-helpers/highlight-cases.json +227 -0
- package/test/fixtures/flea-helpers/source-mime.xml +28 -0
- package/test/fixtures/flea-helpers/syntax-compat.mjs +23 -0
- package/test/fixtures/flea-thumbnail-stub/flea-placeholder.thumbnailer +4 -0
- package/test/fixtures/flea-thumbnail-stub/flea-thumbnail-stub +3 -0
- package/test/fixtures/qml/flea/EscapeHint.qml +11 -0
- package/test/fixtures/qml/flea/LICENSE +21 -0
- package/test/fixtures/qml/flea/README.md +25 -0
- package/test/fixtures/qml/flea/Theme.qml +8 -0
- package/test/fixtures/qml/flea/demo.qml +24 -0
- package/test/fixtures/qml/flea/qmldir +3 -0
- package/test/fixtures/qml/flea-theme/LICENSE-Flea +21 -0
- package/test/fixtures/qml/flea-theme/LICENSE-Omarchy +20 -0
- package/test/fixtures/qml/flea-theme/README.md +70 -0
- package/test/fixtures/qml/flea-theme/button.qml +17 -0
- package/test/fixtures/qml/flea-theme/demo.qml +27 -0
- package/test/fixtures/qml/flea-theme/field.qml +21 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/BorderGeometry.js +373 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Color.qml +258 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/I18n.qml +118 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Numbers.js +19 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Plural.js +91 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Style.qml +561 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/Util.qml +188 -0
- package/test/fixtures/qml/flea-theme/imports/qs/Commons/qmldir +13 -0
- package/test/fixtures/qml/flea-theme/segment.qml +17 -0
- package/test/fixtures/qml/flea-theme/settings.qml +58 -0
- package/test/fixtures/qml/flea-theme/text-metrics.qml +10 -0
- package/test/fixtures/qml/flea-theme/ui/DialogButton.qml +150 -0
- package/test/fixtures/qml/flea-theme/ui/DialogField.qml +147 -0
- package/test/fixtures/qml/flea-theme/ui/EscapeHint.qml +11 -0
- package/test/fixtures/qml/flea-theme/ui/Glass.qml +114 -0
- package/test/fixtures/qml/flea-theme/ui/Glyph.qml +54 -0
- package/test/fixtures/qml/flea-theme/ui/GlyphSolid.qml +22 -0
- package/test/fixtures/qml/flea-theme/ui/Reveal.qml +54 -0
- package/test/fixtures/qml/flea-theme/ui/SettingsRuler.qml +85 -0
- package/test/fixtures/qml/flea-theme/ui/SettingsSegment.qml +85 -0
- package/test/fixtures/qml/flea-theme/ui/StableModel.qml +89 -0
- package/test/fixtures/qml/flea-theme/ui/Theme.qml +460 -0
- package/test/fixtures/qml/flea-theme/ui/ThemeColors.qml +43 -0
- package/test/fixtures/qml/flea-theme/ui/ViewState.qml +565 -0
- package/test/fixtures/qml/flea-theme/ui/js/Anchor.js +379 -0
- package/test/fixtures/qml/flea-theme/ui/js/AnchorHold.js +162 -0
- package/test/fixtures/qml/flea-theme/ui/js/Archive.js +157 -0
- package/test/fixtures/qml/flea-theme/ui/js/BackReturn.js +110 -0
- package/test/fixtures/qml/flea-theme/ui/js/Buttons.js +54 -0
- package/test/fixtures/qml/flea-theme/ui/js/ColumnMenu.js +111 -0
- package/test/fixtures/qml/flea-theme/ui/js/Columns.js +298 -0
- package/test/fixtures/qml/flea-theme/ui/js/Contrast.js +157 -0
- package/test/fixtures/qml/flea-theme/ui/js/Density.js +44 -0
- package/test/fixtures/qml/flea-theme/ui/js/DirSizes.js +129 -0
- package/test/fixtures/qml/flea-theme/ui/js/ExtThumbs.js +115 -0
- package/test/fixtures/qml/flea-theme/ui/js/Filter.js +284 -0
- package/test/fixtures/qml/flea-theme/ui/js/FolderSorts.js +108 -0
- package/test/fixtures/qml/flea-theme/ui/js/Format.js +305 -0
- package/test/fixtures/qml/flea-theme/ui/js/Icons.js +206 -0
- package/test/fixtures/qml/flea-theme/ui/js/Input.js +39 -0
- package/test/fixtures/qml/flea-theme/ui/js/KeyName.js +64 -0
- package/test/fixtures/qml/flea-theme/ui/js/Keymap.js +370 -0
- package/test/fixtures/qml/flea-theme/ui/js/Kinds.js +145 -0
- package/test/fixtures/qml/flea-theme/ui/js/Lists.js +11 -0
- package/test/fixtures/qml/flea-theme/ui/js/MakeDefault.js +186 -0
- package/test/fixtures/qml/flea-theme/ui/js/Match.js +27 -0
- package/test/fixtures/qml/flea-theme/ui/js/Material.js +109 -0
- package/test/fixtures/qml/flea-theme/ui/js/Menu.js +513 -0
- package/test/fixtures/qml/flea-theme/ui/js/Motion.js +16 -0
- package/test/fixtures/qml/flea-theme/ui/js/Mounts.js +320 -0
- package/test/fixtures/qml/flea-theme/ui/js/MouseNav.js +13 -0
- package/test/fixtures/qml/flea-theme/ui/js/Nav.js +328 -0
- package/test/fixtures/qml/flea-theme/ui/js/Palette.js +33 -0
- package/test/fixtures/qml/flea-theme/ui/js/Places.js +236 -0
- package/test/fixtures/qml/flea-theme/ui/js/Protocols.js +296 -0
- package/test/fixtures/qml/flea-theme/ui/js/RecentMode.js +154 -0
- package/test/fixtures/qml/flea-theme/ui/js/Search.js +396 -0
- package/test/fixtures/qml/flea-theme/ui/js/Settings.js +476 -0
- package/test/fixtures/qml/flea-theme/ui/js/SettingsAbout.js +99 -0
- package/test/fixtures/qml/flea-theme/ui/js/SettingsShelf.js +52 -0
- package/test/fixtures/qml/flea-theme/ui/js/Sort.js +127 -0
- package/test/fixtures/qml/flea-theme/ui/js/StateWords.js +42 -0
- package/test/fixtures/qml/flea-theme/ui/js/Swap.js +166 -0
- package/test/fixtures/qml/flea-theme/ui/js/TextSize.js +107 -0
- package/test/fixtures/qml/flea-theme/ui/js/Thumbs.js +158 -0
- package/test/fixtures/qml/flea-theme/ui/js/UiState.js +438 -0
- package/test/fixtures/qml/flea-theme/ui/js/Update.js +132 -0
- package/test/fixtures/qml/flea-theme/ui/js/UserDirs.js +56 -0
- package/test/fixtures/qml/flea-theme/ui/qmldir +227 -0
- package/test/fixtures/qml/hello.qml +26 -0
- package/test/fixtures/qml/imports/Demo/Toolkit/VersionLabel.qml +2 -0
- package/test/fixtures/qml/imports/Demo/Toolkit/VersionLabelNew.qml +2 -0
- package/test/fixtures/qml/imports/Demo/Toolkit/qmldir +3 -0
- package/test/fixtures/qml/imports/components/Badge.qml +15 -0
- package/test/fixtures/qml/imports/logic/base.js +2 -0
- package/test/fixtures/qml/imports/logic/counter.js +4 -0
- package/test/fixtures/qml/imports/logic/math.js +3 -0
- package/test/fixtures/qml/imports/logic/shared.js +3 -0
- package/test/fixtures/qml/imports/main.qml +21 -0
- package/test/fixtures/qml/imports/theme/Theme.qml +8 -0
- package/test/fixtures/qml/imports/theme/qmldir +2 -0
- package/test/fixtures/qml/multiply.qml +61 -0
- package/test/fixtures/qml-canvas-dom.js +90 -0
- package/test/fixtures/qml-media-audio.js +39 -0
- package/test/fixtures/raw-capture-benchmark.json +76 -0
- package/test/helpers/flea-sandbox.js +48 -0
- package/test/helpers/quickshell-fixture.js +125 -0
- package/test/html-clipboard-wayland.test.js +47 -0
- package/test/index.test.js +13 -0
- package/test/manual-casty-without-qml.js +87 -0
- package/test/manual-flea-application.js +49 -0
- package/test/manual-flea-binary.js +62 -0
- package/test/manual-flea-qml.js +9 -0
- package/test/manual-flea-settings.js +40 -0
- package/test/manual-flea-theme.js +40 -0
- package/test/manual-qml-removal.js +46 -0
- package/test/manual-without-qml.js +45 -0
- package/test/qml-canvas-dom.test.js +37 -0
- package/test/qml-clipboard-bridge.test.js +25 -0
- package/test/qml-clipboard-wayland.test.js +40 -0
- package/test/qml-connections-timing.test.js +73 -0
- package/test/qml-dynamic.test.js +401 -0
- package/test/qml-flea-app.test.js +146 -0
- package/test/qml-flea-backend.test.js +78 -0
- package/test/qml-flea-columns-backend.test.js +38 -0
- package/test/qml-flea-compile.test.js +78 -0
- package/test/qml-flea-launcher.test.js +88 -0
- package/test/qml-flea-markdown-backend.test.js +31 -0
- package/test/qml-flea-media.test.js +28 -0
- package/test/qml-flea-navigation-backend.test.js +35 -0
- package/test/qml-flea-navigation-timing.test.js +147 -0
- package/test/qml-flea-preview-backend.test.js +53 -0
- package/test/qml-flea-previews.test.js +163 -0
- package/test/qml-flea-rows.test.js +101 -0
- package/test/qml-flea-textures.test.js +59 -0
- package/test/qml-flea-view-switch.test.js +33 -0
- package/test/qml-flea-wayland.test.js +68 -0
- package/test/qml-flea.test.js +34 -0
- package/test/qml-host.test.js +238 -0
- package/test/qml-imports.test.js +102 -0
- package/test/qml-inherited-handlers.test.js +51 -0
- package/test/qml-input-selection.test.js +66 -0
- package/test/qml-interactions.test.js +309 -0
- package/test/qml-language.test.js +167 -0
- package/test/qml-launcher.test.js +54 -0
- package/test/qml-layout-text.test.js +205 -0
- package/test/qml-media.test.js +63 -0
- package/test/qml-persisted-delegates.test.js +45 -0
- package/test/qml-quickshell-controls.test.js +65 -0
- package/test/qml-quickshell-settings.test.js +62 -0
- package/test/qml-repeater.test.js +72 -0
- package/test/qml-style-updates.test.js +124 -0
- package/test/qml-textures.test.js +66 -0
- package/test/qml-views.test.js +332 -0
- package/test/qml-worker.test.js +69 -0
- package/test/qml.test.js +83 -0
- package/test/raw-capture.test.js +152 -0
- package/test/renderer-host.test.js +11 -0
- package/test/text-input-pointer.test.js +31 -0
- package/test/text-input-scroll.test.js +29 -0
- package/test/text-input.test.js +47 -0
- package/test/wayland-frontend.test.js +83 -0
- package/test/wayland-urlbar.test.js +38 -0
- package/test/window-resize.test.js +36 -0
- package/tools/bench-raw-capture.js +32 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
|
3
|
+
<!-- Low priority: retain the distribution's more specific MIME definitions. -->
|
|
4
|
+
<mime-type type="text/x-buninu-source">
|
|
5
|
+
<comment>Source code</comment>
|
|
6
|
+
<sub-class-of type="text/plain"/>
|
|
7
|
+
<generic-icon name="text-x-script"/>
|
|
8
|
+
<glob pattern="*.jsonl" weight="10"/>
|
|
9
|
+
<glob pattern="*.ndjson" weight="10"/>
|
|
10
|
+
<glob pattern="*.jsonc" weight="10"/>
|
|
11
|
+
<glob pattern="*.json5" weight="10"/>
|
|
12
|
+
<glob pattern="*.jsx" weight="10"/>
|
|
13
|
+
<glob pattern="Dockerfile" weight="10"/>
|
|
14
|
+
<glob pattern="*.cjs" weight="10"/>
|
|
15
|
+
<glob pattern="*.ini" weight="10"/>
|
|
16
|
+
<glob pattern="*.mts" weight="10"/>
|
|
17
|
+
<glob pattern="*.cts" weight="10"/>
|
|
18
|
+
<glob pattern="*.vue" weight="10"/>
|
|
19
|
+
<glob pattern="*.svelte" weight="10"/>
|
|
20
|
+
</mime-type>
|
|
21
|
+
<!-- TSX is ambiguous: prefer TypeScript JSX over Debian's Tiled tileset rule (50). -->
|
|
22
|
+
<mime-type type="text/x-buninu-tsx">
|
|
23
|
+
<comment>TypeScript JSX source</comment>
|
|
24
|
+
<sub-class-of type="text/plain"/>
|
|
25
|
+
<generic-icon name="text-x-script"/>
|
|
26
|
+
<glob pattern="*.tsx" weight="60"/>
|
|
27
|
+
</mime-type>
|
|
28
|
+
</mime-info>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// jsmdcui 0.19.2's Micro rules contain Go regex flags/boundaries unsupported by JS.
|
|
2
|
+
// Adapt those rule objects locally; do not modify the installed npm package.
|
|
3
|
+
export function adaptSyntaxRules(definitions, SyntaxDefinition) {
|
|
4
|
+
function compile(pattern, original) {
|
|
5
|
+
if(typeof pattern!=='string'||!(/\(\?[ims]+\)|\\[<>]/.test(pattern)))return original;
|
|
6
|
+
const flags=new Set();
|
|
7
|
+
const source=pattern.replace(/\(\?([ims]+)\)/g,(_,letters)=>{for(const flag of letters)flags.add(flag);return '';})
|
|
8
|
+
.replaceAll('\\<','\\b(?=\\w)').replaceAll('\\>','(?<=\\w)\\b');
|
|
9
|
+
const regex=new SyntaxDefinition({}, {rules:[{compat:source}]}).rules[0]?.regex;
|
|
10
|
+
if(!regex)return original;
|
|
11
|
+
try{return new RegExp(regex.source,[...new Set([...regex.flags,...flags])].join(''));}catch{return original;}
|
|
12
|
+
}
|
|
13
|
+
function visit(rules) {
|
|
14
|
+
for(const rule of rules){
|
|
15
|
+
if(rule.type==='pattern')rule.regex=compile(rule.source,rule.regex);
|
|
16
|
+
if(rule.type==='region'){
|
|
17
|
+
for(const key of ['start','end','skip'])rule[key]=compile(rule.source?.[key],rule[key]);
|
|
18
|
+
visit(rule.rules);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
for(const definition of definitions)visit(definition.rules);
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
|
|
3
|
+
// The word that closes a surface, in the corner every surface puts it in: Dialogs rule 7, and the
|
|
4
|
+
// spelling ui/SettingsPanel.qml already uses, so no two dialogs can name the way out differently.
|
|
5
|
+
Text {
|
|
6
|
+
text: "esc"
|
|
7
|
+
color: Theme.color.muted
|
|
8
|
+
font.family: Theme.font.family
|
|
9
|
+
font.pixelSize: Theme.font.caption
|
|
10
|
+
textFormat: Text.PlainText
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GM
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Flea leaf-component import test
|
|
2
|
+
|
|
3
|
+
`EscapeHint.qml` is an unchanged copy of `ui/EscapeHint.qml` from
|
|
4
|
+
https://github.com/thisisgm/flea at f21789e56cc4b0877caa3156fff7bce52a8dd9c2.
|
|
5
|
+
MIT, Copyright (c) 2026 GM; see LICENSE.
|
|
6
|
+
|
|
7
|
+
`demo.qml` now imports this component normally through `import "." as Flea`
|
|
8
|
+
and `qmldir`. Two instances share `Theme.qml`, a **local test theme** declared
|
|
9
|
+
as a real QML singleton. The button changes its property and both labels react.
|
|
10
|
+
There is no source-body inlining or injected global JavaScript Theme object.
|
|
11
|
+
|
|
12
|
+
This Theme.qml is our test implementation, not Flea's upstream Theme. The real
|
|
13
|
+
Flea Theme also needs Omarchy modules, Quickshell services and more QML syntax.
|
|
14
|
+
Those dependencies remain explicit compatibility gaps, not silent stubs.
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
XDG_RUNTIME_DIR=/tmp WAYLAND_DISPLAY=wayland-buninu bun test/manual-flea-qml.js
|
|
18
|
+
bun test test/qml-flea.test.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
EscapeHint 保留上游原碼與授權。範例透過真正的相對 import、qmldir 與 QML
|
|
22
|
+
singleton 載入兩個實例;按鈕會修改共用主題,兩個 esc 一起變色。
|
|
23
|
+
不再拼接元件內容,也不注入 JS 全域 Theme。
|
|
24
|
+
|
|
25
|
+
Theme.qml 是明確標示的測試主題,並非 Flea 上游的 Omarchy 主題實作。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pragma Singleton
|
|
2
|
+
import QtQuick
|
|
3
|
+
// Test theme, not Flea's Omarchy-dependent Theme.qml. Loaded normally via qmldir.
|
|
4
|
+
QtObject {
|
|
5
|
+
property bool alternate: false
|
|
6
|
+
readonly property var color: ({muted: alternate ? "#ffcc66" : "#70e1e8"})
|
|
7
|
+
readonly property var font: ({family: "sans-serif", caption: 24})
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls
|
|
3
|
+
import Quickshell
|
|
4
|
+
import "." as Flea
|
|
5
|
+
FloatingWindow {
|
|
6
|
+
title: "Browser — Flea real import test"
|
|
7
|
+
color: "#172b36"
|
|
8
|
+
Column {
|
|
9
|
+
width: parent.width - 64
|
|
10
|
+
anchors.centerIn: parent
|
|
11
|
+
spacing: 24
|
|
12
|
+
Text { text: "Flea EscapeHint.qml — real import"; color: "white"; font.pixelSize: 24 }
|
|
13
|
+
Text { text: "Local Theme.qml singleton (test theme)"; color: "#a9bcc6" }
|
|
14
|
+
Item {
|
|
15
|
+
width: parent.width; height: 50
|
|
16
|
+
Flea.EscapeHint { id: first }
|
|
17
|
+
Flea.EscapeHint { id: second; x: 180 }
|
|
18
|
+
}
|
|
19
|
+
Button {
|
|
20
|
+
text: "Toggle shared theme"
|
|
21
|
+
onClicked: { Flea.Theme.alternate = !Flea.Theme.alternate; }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GM
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) David Heinemeier Hansson
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Real Flea Theme fixture
|
|
2
|
+
|
|
3
|
+
Unmodified dependency sources, selected by the QML import graph:
|
|
4
|
+
|
|
5
|
+
- `ui/`: https://github.com/thisisgm/flea at `f21789e56cc4b0877caa3156fff7bce52a8dd9c2`, MIT (`LICENSE-Flea`).
|
|
6
|
+
- `imports/qs/Commons/`: https://github.com/basecamp/omarchy at `3c7027db2a4fa9fa6a49d7af7f87c27ac48e677d`, MIT (`LICENSE-Omarchy`).
|
|
7
|
+
- `demo.qml`: our test window. Both original qmldir files are preserved; entries outside the tested dependency graph are not bundled.
|
|
8
|
+
|
|
9
|
+
Unlike `../flea/`, this fixture uses the actual Theme.qml, ThemeColors.qml,
|
|
10
|
+
Glass.qml, ViewState.qml and Omarchy Color/Style/Util singletons. Nothing injects
|
|
11
|
+
fake Theme/Style values. Test HOME contains sample colors.toml and shell.toml;
|
|
12
|
+
these are input data, not substitute QML implementations.
|
|
13
|
+
|
|
14
|
+
`bun test/manual-flea-theme.js` opens it on the existing Wayland socket and creates
|
|
15
|
+
an isolated temporary HOME. Closing the window removes that temporary directory.
|
|
16
|
+
`bun test test/qml-host.test.js` verifies real palette parsing, measured column
|
|
17
|
+
widths, font size changes through the theme.name watch, process output and cleanup,
|
|
18
|
+
and return from local QML host mode to ordinary sandboxed HTML.
|
|
19
|
+
|
|
20
|
+
No running Hyprland or Flea Rust backend is required for this Theme test. Missing
|
|
21
|
+
hyprctl takes the upstream fallback paths; live Hyprland-dependent GlassTagger
|
|
22
|
+
creation and full Flea settings writes are not claimed as tested or supported.
|
|
23
|
+
The current test covers the Theme path on Land, not the entire Flea application.
|
|
24
|
+
|
|
25
|
+
本目錄保留真正上游 QML/JS;Theme 及 Commons 不是 stub。手動示範使用獨立的
|
|
26
|
+
臨時 HOME,讀入範例 TOML,關窗後移除。測試涵蓋主題讀取、文字尺寸、主題更新、
|
|
27
|
+
程序輸出與清理,以及切回普通網頁的隔離。未宣稱完整 Flea 或 Hyprland 相容。
|
|
28
|
+
|
|
29
|
+
## SettingsRuler
|
|
30
|
+
|
|
31
|
+
`ui/SettingsRuler.qml` is another unchanged file from the same Flea revision.
|
|
32
|
+
`settings.qml` is our interactive test wrapper: selecting a size changes the real
|
|
33
|
+
ViewState in memory; Theme updates both the original ruler and a text preview.
|
|
34
|
+
The wrapper does not call the persistent settings writer.
|
|
35
|
+
|
|
36
|
+
`test/qml-quickshell-settings.test.js` optionally runs the same wrapper and upstream
|
|
37
|
+
sources with a locally available Quickshell binary on an isolated Land instance.
|
|
38
|
+
Qt eagerly checks qmldir entries absent from this subset, so only its temporary
|
|
39
|
+
fixture copy filters those missing entries. No QML/JS source is replaced or stubbed.
|
|
40
|
+
The repository's original qmldir files remain unchanged.
|
|
41
|
+
|
|
42
|
+
SettingsRuler 來自同一上游版本,原檔未修改。互動範例只調整記憶體內的 ViewState,
|
|
43
|
+
不寫個人設定;Quickshell 對照的暫存副本只刪除未打包檔案的 qmldir 索引。
|
|
44
|
+
|
|
45
|
+
## Additional unchanged controls and models
|
|
46
|
+
|
|
47
|
+
The following files are copied byte-for-byte from the same Flea revision above:
|
|
48
|
+
|
|
49
|
+
- `ui/SettingsSegment.qml`, `ui/DialogButton.qml`, `ui/DialogField.qml`
|
|
50
|
+
- `ui/Glyph.qml`, `ui/GlyphSolid.qml`, `ui/Reveal.qml`, `ui/StableModel.qml`
|
|
51
|
+
- `ui/js/Icons.js`, `ui/js/Motion.js`
|
|
52
|
+
|
|
53
|
+
`button.qml`, `field.qml` and `segment.qml` are our small test wrappers, not
|
|
54
|
+
upstream files. DialogButton and DialogField are tested both through this browser
|
|
55
|
+
and the genuine Quickshell binary. StableModel is tested with a virtualized view,
|
|
56
|
+
including resizing and warm delegates. Source fixtures are not reformatted.
|
|
57
|
+
|
|
58
|
+
The larger `qml-flea-app`, `qml-flea-previews`, `qml-flea-compile` and
|
|
59
|
+
`qml-flea-wayland` opt-in tests read existing external checkouts instead of
|
|
60
|
+
bundling the entire Flea application. They use a temporary HOME and XDG state;
|
|
61
|
+
backend replies are never replaced. Without an explicitly supplied real FLEA_BIN,
|
|
62
|
+
the unavailable backend state is expected. Those tests do not claim file-manager
|
|
63
|
+
operations or mounting work.
|
|
64
|
+
|
|
65
|
+
本輪新增的上述上游檔案均保持原文;三個 wrapper 是自製測試入口。
|
|
66
|
+
完整主程式測試讀取隔壁既有 checkout,不把整個 Flea 打包進本專案,
|
|
67
|
+
也不偽造後端服務。沒有實際後端時,不能據此宣稱檔案操作已通過。
|
|
68
|
+
|
|
69
|
+
`text-metrics.qml` is also our wrapper. It compares empty-string and multiline
|
|
70
|
+
line counts with the actual Quickshell binary; no Qt implementation source is used.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import Quickshell
|
|
3
|
+
import "./ui" as Flea
|
|
4
|
+
FloatingWindow {
|
|
5
|
+
id: demo
|
|
6
|
+
width: 600; height: 320
|
|
7
|
+
color: Flea.Theme.color.background
|
|
8
|
+
title: "Flea buttons | "+presses
|
|
9
|
+
Component.onCompleted: action.forceActiveFocus()
|
|
10
|
+
property int presses: 0
|
|
11
|
+
Column {
|
|
12
|
+
x:24;y:24;spacing:24
|
|
13
|
+
Flea.DialogButton {id:action;label:"Activate";primary:true;tabStop:true;onActivated:demo.presses++}
|
|
14
|
+
Flea.DialogButton {label:"Disabled";available:false}
|
|
15
|
+
Text {id:status;text:"Activated: "+demo.presses;color:Flea.Theme.color.foreground}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls
|
|
3
|
+
import Quickshell
|
|
4
|
+
import "./ui" as Flea
|
|
5
|
+
FloatingWindow {
|
|
6
|
+
id: demo
|
|
7
|
+
property bool alternate: false
|
|
8
|
+
title: "Flea — real Theme and Omarchy Commons"
|
|
9
|
+
width: 800; height: 760
|
|
10
|
+
color: Flea.Theme.color.background
|
|
11
|
+
Column {
|
|
12
|
+
x: 24; y: 20; spacing: 12
|
|
13
|
+
Text {text: "Real Flea Theme"; color: Flea.Theme.color.foreground; font.pixelSize: 24}
|
|
14
|
+
Text {id: readiness; text: "Palette ready: " + Flea.Theme.ready; color: Flea.Theme.color.muted; font.pixelSize: 16}
|
|
15
|
+
Flea.EscapeHint {}
|
|
16
|
+
Button {
|
|
17
|
+
text: "Toggle palette"
|
|
18
|
+
onClicked: {
|
|
19
|
+
demo.alternate = !demo.alternate
|
|
20
|
+
Flea.Theme.applyColors(demo.alternate
|
|
21
|
+
? 'background = "#202030"\nforeground = "#ffeebb"\naccent = "#ffcc66"\nred = "#ff3333"'
|
|
22
|
+
: 'background = "#101315"\nforeground = "#eeeeee"\naccent = "#70e1e8"\nred = "#ff3333"')
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
Text {id: metrics; text: Flea.Theme.tokens(); color: Flea.Theme.color.foreground; font.pixelSize: 13; font.family: Flea.Theme.font.family}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import Quickshell
|
|
3
|
+
import "./ui" as Flea
|
|
4
|
+
FloatingWindow {
|
|
5
|
+
id:demo;width:600;height:320
|
|
6
|
+
property string source:"first"
|
|
7
|
+
property int edits:0
|
|
8
|
+
property int accepts:0
|
|
9
|
+
property int tabs:0
|
|
10
|
+
color:Flea.Theme.color.background
|
|
11
|
+
title:"Flea field | "+field.text+" | "+edits+":"+accepts+":"+tabs
|
|
12
|
+
Flea.DialogField {
|
|
13
|
+
id:field;x:24;y:24;width:300;label:"Name";text:demo.source
|
|
14
|
+
onEdited:demo.edits++
|
|
15
|
+
onAccepted:demo.accepts++
|
|
16
|
+
onTabbed:function(from,back){demo.tabs+=back?-1:1}
|
|
17
|
+
}
|
|
18
|
+
Text {id:status;y:150;text:field.text+"|"+demo.edits+":"+demo.accepts+":"+demo.tabs;color:Flea.Theme.color.foreground}
|
|
19
|
+
Flea.DialogButton {id:change;x:24;y:200;label:"Change";onActivated:demo.source="second"}
|
|
20
|
+
Component.onCompleted:field.takeFocus()
|
|
21
|
+
}
|