1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-11 09:04:01 +03:00
Commit Graph

393 Commits

Author SHA1 Message Date
Samuel Dionne-Riel
fceb420383 boot/splash: Load SVG using new resize workaround 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
7bc16d7996 boot/splash: Use night theme...
It would probably benefit from an actually bespoke totally
white-on-black theme.
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
61ebf3d2f4 boot/error: Use assets path 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
87ac4c8813 boot/error: Load SVG using new resize workaround 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
0a397decfe boot/recovery-menu: Use mkLVGUIApp 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
4e2cd380a0 boot/recovery-menu: Normalize LVGUI consumers 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
11f982bf97 boot/splash: Use mkLVGUIApp 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
9df0e1bbdf boot/splash: Normalize LVGUI consumers 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
9407ac1084 boot/error: Use mkLVGUIApp 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
6c7f1371f9 boot/error: Normalize LVGUI consumers 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
9cd0668f23 lvgui: Reduce enhanced header bar size in landscape
This helps gain some precious screen real-estate for e.g. laptop use
cases.
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
4937f6ad46 lvgui: Provide default font sizes
This is not used, but almost was. This would allow increasing or
reducing relative to the defaults, rather than hardcoding a value.
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
b77cd6f5c2 lvgui: Fixes for landscape uses
Mainly we fit the content to a 720dp wide column. This ensures the
layout stays the same everywhere.

(Yet TODO, make the header take less space in landscape)
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
a4233cc960 lvgui: Constrain header bar to a "720dp" column 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
8be50b7a6f lvgui: Add HeaderLabel 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
4ee19f9048 lvgui: Use the NixOS theme 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
5a7d09bcd6 lvgui: Make base window use the app background 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
0e1b8b47c4 lvgui: Review assets path 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
14e78352c1 lvgui: Use Fonts helpers to provide fonts
This decouples the actually-in-use assets from the native parts of
LVGUI.
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
29ce88d750 lvgui: Add Fonts 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
39f6efa8c5 lvgui: Default to NixOS theme 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
5ff3bb9f88 lvgui: Add back support for night theme 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
6cb9a81938 lvgui: Drop nanosvg resize hack 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
f614ebf630 lvgui: Add font loading bindings 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
6017552e1d lvgui: Add basic assets path support
Still needed: actually providing a useful path
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
61205f5e55 lvgui: Add point_scale
Will be used for fonts
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
f546b3dcb4 lvgui: Allow setting style from add_button helper 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
42694ea008 lvgui: Add style modifier functions for buttons 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
6d01610062 lvgui: Drop unneeded logging 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
73c197bf1a lvgui: BackButton: fix metrics 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
898be48fba lvgui: OptionsSelection: rework a bit 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
f1ceb95cd9 lvgui: Rework Toolbar a bit 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
1069f1aa0a lvgui: Update Page 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
b05c4a7e29 lvgui: Bind more 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
aff5df2cb8 lvgui: Add MobileNixOS namespace 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
cee29f9a05 lvgui: Add initialization hook to BaseWindow 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
e3e1ce9191 lvgui: Add header hook to base window
This allows any uses of BaseWindow to add something to the flow at the
location the header bar would be.
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
bf3cc95968 lvgui: Add header bar 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
3c6c72d0d6 lvgui: Add Placeholder widget
Used to replace something while the other thing is not available...

(wow, such clarity)
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
3419dd6035 lvgui: Move general stuff in __init 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
aae04ccd45 lvgui: Use correct fonts for status bar 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
3d032921fa lvgui: Extract status_bar 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
604e46a1b8 lvgui: extract clock 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
93c9a3d35d lvgui: extract back button 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
30dd4a0ce2 lvgui: Rework back button a bit 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
f8fd4bd919 lvgui: Extract button
As it's meant to be inherited from inside of LVGUI too, prefix it with
an underscore so it's lexicographilcally preferred :/
2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
a1934c41a8 lvgui: Extract horizontal separator 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
ff9464c947 lvgui: Extract battery 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
90f629e309 lvgui: Extract page 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
1127cee44f lvgui: Extract the base widget 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
8f41fa751a lvgui: Extract screen in a file 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
2fee791301 lvgui: Extract toolbar in a file 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
505f58e8f7 lvgui: Define scalable sizes 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
f9e13d3e06 lvgui: header -> status bar 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
cd27836faf lvgui: Use the NixOS theme 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
bad1f0566d lvgui: Add colors 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
2d2e852b58 lvgui: Export LVGL 'DPI' 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
1a66222e0b lvgui: 2021-02-20 -> 2021-07-19 2021-07-19 15:50:06 -04:00
Samuel Dionne-Riel
b4e6f98fc6 boot/lib: Make reboot modes HAL more robust
Allows running in the simulator.
2021-07-15 18:16:47 -04:00
Samuel Dionne-Riel
2410994f17 boot/lib: Be a bit more resilient outside of stage-1
Mainly allows using the simulator with the error applet
2021-07-15 18:16:47 -04:00
Samuel Dionne-Riel
29e2940ca2 boot/lib: init xdg.rb 2021-07-15 18:16:47 -04:00
Samuel Dionne-Riel
98e2ab907f
Merge pull request #305 from samueldr-wip/feature/lvgui-pan
lvgui: "pan" framebuffers
2021-02-23 20:59:51 -05:00
Samuel Dionne-Riel
d82733b13e
Merge pull request #306 from samueldr-wip/fix/armv7l
armv7: Misc. fixes
2021-02-23 20:59:28 -05:00
Samuel Dionne-Riel
fb11c6f3fe boot/script-loader: Strip store path hashes
This is required otherwise nuke-refs will destroy the irep.
2021-02-20 17:23:01 -05:00
Samuel Dionne-Riel
072325ce00 boot/script-loader: Fix for new mruby.builder 2021-02-20 17:23:01 -05:00
Samuel Dionne-Riel
441701d215 lvgui: Update native fragment 2021-02-20 16:41:23 -05:00
Samuel Dionne-Riel
32f86364a1 boot/init: Make udev a dependency for the switch root target
In some instances, e.g. really slow CPU, udev might not have run, and
libinput will not be able to work appropriately.

That is because uevent files will be missing.
2021-02-20 16:40:38 -05:00
Samuel Dionne-Riel
7332254db2
Merge pull request #298 from MetaDark/fix-libxkbcommon
boot/lib/lvgui: fix libxkbcommon after nixpkgs#108004
2021-02-15 17:22:37 -05:00
Samuel Dionne-Riel
f0a7e33767 boot/init: switch root forwards FDT properties as needed 2021-02-11 18:15:34 -05:00
Samuel Dionne-Riel
b667d2298f boot/init: kexec now uses generation DTB if possible
Fixes #264
2021-02-11 18:15:23 -05:00
Samuel Dionne-Riel
2a46962d76 boot/init: Honor skipping kexec 2021-02-11 18:14:30 -05:00
Samuel Dionne-Riel
aea3b46d13 boot/recovery-menu: Add option to skip kexec
But why?

Multiple reasons:

 - generation kernel does not work as expected
 - booting a boot.img with an experimental kernel

I'm sure there's other reasons too.

Fixes #266
2021-02-11 18:14:30 -05:00
Samuel Dionne-Riel
5d50144468 boot/recovery-menu: Pass data around using JSON 2021-02-11 18:14:30 -05:00
Kira Bruneau
7beb26204f boot/lib/lvgui: fix libxkbcommon after nixpkgs#108004 2021-02-09 17:55:57 -05:00
Samuel Dionne-Riel
225ed39dad Fix stdenv.lib being removed
Deals with https://github.com/NixOS/nixpkgs/pull/111284
2021-02-02 05:51:18 -05:00
Samuel Dionne-Riel
76b5e79ca5 boot/init: Add System.umount() 2021-01-27 19:09:07 -05:00
Samuel Dionne-Riel
5ba41dd963 boot/init: Fix shellOnFail
- It was running too late.
 - Wasn't actually using `shellOnFail` config
2021-01-27 19:09:07 -05:00
Samuel Dionne-Riel
ba2873771d lvgui: 2020-11-20 -> 2021-01-23 2021-01-25 18:40:54 -05:00
Samuel Dionne-Riel
7a0f906571 boot/lib/lvgui: Add add_select helper 2021-01-25 18:40:54 -05:00
Samuel Dionne-Riel
919e1b2ab1 boot/lib/lvgui: Better explain event handler in impl. 2021-01-25 18:40:54 -05:00
Samuel Dionne-Riel
0f0625d359 boot/lib/lvgui: Add option selector
A bit like a "drop down" select
2021-01-25 18:40:54 -05:00
Samuel Dionne-Riel
6d85c00ce0 boot/lib/lvgui: Add a debug styles helper
This way it's easy to just colour an element when visualizing its
metrics.
2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
562c8ab081 boot/lib/lvgui: Add HorizontalSeparator 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
8d4a660526 boot/lib/lvgui: Use dummy object in base window 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
e23870f2af boot/lib/lvgui: Add a dummy object
It was found, through some debugging, that we were adding a
non-invisible dummy object for focus group handling. With this change
we have a common dummy object to use for this purpose.
2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
1b8e5f2844 boot/lib/lvgui: Focus stack push/pop also works for event handlers 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
029938e6f1 boot/lib/lvgui: Add focus group "stacks"
This probably should not have been added straight onto LVGL bindings,
but that's where they're the easiest to implement safely.

This allows a widget to take control of the focus group, while allowing
the previous content to be re-added properly.
2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
2c06866f2e boot/lib/lvgui: Add accessors for built-in layers 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
c4eb57f4cf boot/lib/lvgui: Bind color maths helper 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
0c4b3e9580 boot/lib/lvgui: Bind more for scrollable pages 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
9aff7f666b boot/lib/lvgui: Add button style accessors 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
7fb3f2b377 boot/lib/lvgui: Add add_switch helper 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
eebb09e790 boot/lib/lvgui: Add BaseUIElements mixin
Where more generic one-off helpers will be added
2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
1cb820a9ac boot/lib/lvgui: Add SwitchLine control 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
99a7262a24 boot/lib/lvgui: Add toggle switch basic bindings 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
995f32a30e boot/lib/lvgui: Add display driver to introspection 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
78f6798175 boot/init: Graphics can also mean DRM 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
fe77a60ff3 boot/lib/lvgui: Add libdrm 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
4ea165c2fb boot/lib/lvgui: Add libinput 2021-01-25 18:40:50 -05:00
Samuel Dionne-Riel
2145e68e7d
Merge pull request #288 from samueldr-wip/master
boot/init: Work around gadget teardown errors
2021-01-25 16:58:52 -05:00
Samuel Dionne-Riel
edf2e83a20 boot/init: Work around gadget teardown errors
Those errors are non-issues.

Tear-down should, anyway, be implemented in a library to be used in
other tools like target disk mode and a stage-2 gadget utility.
2021-01-24 23:38:54 -05:00
Samuel Dionne-Riel
6e274d86bd boot/error: Fix by adding missing dependency 2021-01-24 23:36:34 -05:00
Samuel Dionne-Riel
badb5c635b boot/init: Add System.symlink
Same as File.symlink, but logged.

(Also fixes logging of System.write)
2021-01-03 23:08:24 -05:00
Samuel Dionne-Riel
b4c603bc56 boot/init: Tear down usb gadget on kexec
Yikes, specialized code in the kexec codepath... though this is okay for
now. Let's not over-generalize when we don't know what will be required
in the future for abstraction.
2021-01-03 20:23:44 -05:00
Samuel Dionne-Riel
2d3ba8d21d boot/init: Add System.delete() to delete files or directories 2021-01-03 20:23:44 -05:00
Samuel Dionne-Riel
19ff65e821 boot/lib: Remove accidentally left puts 2021-01-02 00:55:21 -05:00
Samuel Dionne-Riel
2fefc0ae5b boot/splash: Fixes for extracted libs
And additionally review how it's built.
2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
dc809d47bd boot/lib: Import splash components in lvgui 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
7cd9acd991 boot/splash: Remove useless var 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
966f000c5d boot/error: Use extracted reboot mode hal 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
562ddc1272 boot/recovery-menu: Use extracted reboot mode hal 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
50a2a08e09 boot/lib: Extract reboot modes lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
a12e4314dc boot/recovery-menu: Use extracted configuration lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
d0ad7a8a20 boot/init: Use extracted configuration lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
af9912ef81 boot/lib: Import init configuration lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
3cde402440 boot/init: Use extracted monkey patches 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
e6e4e228a4 boot/lib: Move init monkey patches 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
b50024f29b boot/error: describe libraries used 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
45a4835ebe boot/recovery-menu: describe libraries used 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
bec41be25b boot/splash: describe libraries used 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
6ca59e8cfb boot/init: Describe specific libraries to include 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
4b0a275cc1 boot/splash: Fixes for script-loader changes 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
74498792ee boot/recovery-menu: Fixes for script-loader changes 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
d18d3615e6 boot/script-loader: Use the mruby-lvgui-native-fragment 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
447d8d59e7 boot/script-loader: Add mruby-lvgui-native-fragment 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
ffc4a12fa1 boot/lib: Import lvgui ruby implementation 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
b88d2565ee boot/lib: Stash evdev lib in a folder 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
b33afce1a0 boot/init: Re-format mrbc invocation 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
e88ace2a3e boot/init: switch_root keeps selected generation in stage-0 2020-12-29 17:59:09 -05:00
Samuel Dionne-Riel
e9dba7afb9 boot/init: Fix logic in symlink resolution 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
ebd095e019 boot/init: AutoResize only if needed 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
22ba517ac8 boot/init: Control the splash fades for kexec 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
fa4804e67d boot/init: Add kernel cmdline helper 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
cb0d21d2fc boot/init: booting from kexec communicated using cmdline 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
200e5aac1b boot/init: Kexecing keeps the splash as-is 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
b82492a565 boot/init: Use kexec only in stage-0. 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
eed796865e boot/init: Use configurable stage value 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
6ad92214da boot/init: switch_root can and will kexec
This is partly complete; we need to handle the situation where **only**
stage-0 should kexec into the next system.

This is yet to be implemented, but will be done through a configuration
that transforms the current bootloader-launched stage-1 into a stage-0,
while keeping the on-disk stage-1 stage-1.
2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
812b02dd32 boot/init: Fix partial teardown for splash
`#quit` would leave the `@pid` variable around, which in turn meant that
calling `#kill` after would fail since the process was already gone.
2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
ad4efeff2f boot/splash: Allow skipping fade-out (sticky) 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
bece0564d8 boot/splash: Allow skipping fade-in 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
2ab969db37 boot: LUKS errors are "controlled"
This means that we shouldn't raise an exception, but rather fail
outright. The background being black means that things *failed
successfully*, as expected.
2020-11-30 20:45:03 -05:00
Samuel Dionne-Riel
fd0a9856bd boot/init: publish desire for recovery mode 2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
67957f4972 boot/init: Move recovery detection to an abstraction layer 2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
ff9d66713e boot/splash: Update UI before executing commands
Otherwise we might miss the last message, which may include things to
present to the user, e.g. the label "Continuing to ..."
2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
cfba499677 boot/splash: Add recovery notification support
To be shown, the publisher has to publish the `recovery` value.
2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
841b835b05 boot/init: update comments in switch_root
It better describes the reasoning for the keys than the previous
"off-the-cuff" comment I left myself.
2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
ae9ce35a90 boot/lib: Implement evdev query through FFI 2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
5928902108 boot/lib: add generated linux input event codes
This could be done a build-time, but it's not like we actually need it
to be the freshest ever.

We're free to update it whenever.
2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
65d570144f boot/misc: Add script to generate linux input event codes 2020-11-22 16:48:32 -05:00