Commit Graph

97 Commits

Author SHA1 Message Date
tomasklaen
e994867799 fix: TopBar not initializing all the values it needs
closes #193
2022-09-13 21:41:21 +02:00
tomasklaen
ebccd11328 feat!: consolidate all *_font_scale options into one font_scale
ref #185
2022-09-13 17:55:31 +02:00
tomasklaen
e8239e88c9 fix: menu item hint clipping not accounting for spacing
closes #191
2022-09-13 13:43:09 +02:00
tomasklaen
a110ddcc95 fix: shift+enter in menus was not bound to soft opening items 2022-09-13 13:33:52 +02:00
tomasklaen
fc8c554f85 fix: broken active item indexes in self updating menus 2022-09-13 13:24:48 +02:00
tomasklaen
bf012b2485 fix: volume position sometimes not adjusting to controls 2022-09-13 12:35:11 +02:00
tomasklaen
b98e58654d fix: controls bar invisible when timeline disabled while hovered
ref #188
2022-09-13 12:11:35 +02:00
tomasklaen
7f05a75db4 fix: top bar buttons not inheriting top bar visibility 2022-09-13 11:56:47 +02:00
tomasklaen
386953b78e tweak: switch to round icons 2022-09-13 11:48:49 +02:00
christoph-heinrich
079b0a4f50 fix: is_protocol() not returning a boolean (#180)
Returning a string instead of a boolean is fine in most cases,
but if the result gets compared against a boolean this breaks things.
2022-09-13 11:12:20 +02:00
tomasklaen
56a60629e1 fix: control bar buttons loosing focus on item load
closes #190
2022-09-13 10:25:50 +02:00
tomasklaen
193f0706af refactor!: active and selected_index menu API
Allows multiple items in a menu to be `active`. `select` flag is no longer on the item, but moved to the menu properties as `selected_index`.
2022-09-13 10:22:36 +02:00
tomasklaen
aeac6523d6 feat: add update-menu API
closes #171
2022-09-13 00:11:30 +02:00
tomasklaen
9b64c529ac refactor!: element system, menu implementation, ...
With this, the codebase is mostly typed (as much as sumneko's type checking allows), and finally go-to-definition-able.

This refactor changed or touched more than 90% of the codebase, so here's just the most notable changes I can recall:

Menu implementation is now way more robust, and supports:
- live menu updates
- opening submenus allows navigating to parent menus
- items icons and bold & italic styling
- keeping menu open after selecting the item
- peeking submenus
- and a lot of other small tweaks

The menu input data structure changed. It no longer accepts `active_index` and `selected_index`, instead, each item can now have `active` or `selected` property.

And I'm sure there's a lot I'm forgetting to mention, but it's midnight here T.T

closes #144, ref #171, closes #176
2022-09-12 23:53:37 +02:00
tomasklaen
87e7e9ec09 refactor: make ass:tooltip accept elements 2022-09-07 22:58:22 +02:00
tomasklaen
03abd30f8c feat: add tooltips 2022-09-07 14:09:00 +02:00
tomasklaen
29834b4d88 fix: improve top bar visibility
closes #168
2022-09-07 12:52:02 +02:00
christoph-heinrich
c128b0d151 fix: chapter indicator visibility when over progress line (#175)
Differentiate between parts of chapter indicator that are covered by the
progress line/bar and parts that are not.
2022-09-07 12:20:34 +02:00
christoph-heinrich
15aa20b93a fix: chapter ranges not using their opacity config (#173) 2022-09-07 12:00:17 +02:00
tomasklaen
0403de1a35 fix: subs track menu not selecting disabled item 2022-09-07 11:55:08 +02:00
tomasklaen
a501ded419 feat: improve track selection menus
Adds `load-audio`, `load-video` menus, adds load file item to all track selection menus, makes disabled subtitle item a bit more prominent and styled appropriately.

Notable addition: new `muted` property for menu items which makes the title half the opacity.

closes #169, closes #170
2022-09-07 11:45:12 +02:00
tomasklaen
0109e5ce8e feat: improve menu styling
Fixes couple things, makes menu prettier with borders, and adds `bold` and `italic` props to each menu item.
2022-09-07 10:25:05 +02:00
tomasklaen
b6d45e5bd7 fix: remove obsolete options, add persistency to controls, update conf file 2022-09-07 08:46:42 +02:00
tomasklaen
fa1b2112ec feat: implement controls bar
Also includes a lot of refactoring around codebase to make it work as needed.

Notable addition: new `items` command that displays playlist if any, or open-file otherwise.

ref #167, closes #71
2022-09-06 20:02:35 +02:00
christoph-heinrich
468fadff0f feat: support osc-margins shared-script-property (#166)
The documentation cautions against using shared script properties, but
console.lua relies on the margin to not overlap with the bottom bar from
the default osc. Without support for that in uosc, using the console
was always annoying.

Now it also doesn't overlap with the uosc timeline.
The script property gets updated on render whenever at least one of of
the margins changed.
2022-09-03 08:55:07 +02:00
christoph-heinrich
454cab8d26 refactor: move chapter range handling into loop and break early (#162) 2022-09-01 15:18:17 +02:00
tomasklaen
2008b776fa fix: top bar title not inheriting opacity 2022-09-01 13:09:44 +02:00
christoph-heinrich
a4b32e4edc feat: don't show tooltips for chapters that only end a range (#153)
Chapters that end a chapter range and are matched by something other
then `.*` are now not shown when hovering over that chapter,
unless that chapter is also used to start another range.
2022-09-01 13:00:35 +02:00
christoph-heinrich
7224760820 fix: cap volume to >= 0 (#161)
With a step size of 1 it was possible to set volume to -1.
mpv permits setting volume to -1 for legacy reasons, so cap it in the ui.

There was a `set_from_cursor` method for setting volume in the speed element.
Probably got copied there at some point by accident.
2022-09-01 10:49:03 +02:00
tomasklaen
92a8ec2281 fix: top bar title missing border
closes #158, closes #160
2022-09-01 10:45:30 +02:00
christoph-heinrich
b84d272b3c fix: remove unneeded closing curly brace from title (#159) 2022-09-01 10:41:58 +02:00
tomasklaen
60ded9c0f2 style: tweak declarations, suppress warnings, reformat 2022-09-01 10:38:40 +02:00
tomasklaen
e276ae14cb feat: always display volume controls, and visualize no audio
This is a media player after all, it makes sense to be able to control it's volume even when playing files with no audio. We might implement image viewing mode in the future, but for now, this stays enabled.

closes #154
2022-09-01 10:28:28 +02:00
christoph-heinrich
1585bc30aa fix: nil error in show-menu api (#156)
The local `menu` shadowed the global `menu`, thus accesing it's methods
didn't work.
2022-08-31 17:24:56 +02:00
christoph-heinrich
ad2123744b fix: compatiblity with unpack and table.unpack (#155)
In Lua 5.2 the unpack global has been moved to table.unpack
To keep compatiblity with 5.1 and newer, choose depending on what's
available.
2022-08-31 17:20:33 +02:00
tomasklaen
6eb48fa571 fix: render_volume() doesn't need to check for has_audio 2022-08-31 17:13:14 +02:00
tomasklaen
39ae0650c1 refactor: abstract drawing text, rectangles, and circles 2022-08-31 17:04:30 +02:00
christoph-heinrich
272a8efb47 fix: cursor line visually not matching cursor when on top of foreground (#150) 2022-08-31 12:24:47 +02:00
christoph-heinrich
c94914cca1 fix: cursor to time conversion was half a pixel imprecise (#152)
When clicking at a pixel, one would expect to click at the middle of
that pixel instead of the left edge of that pixel.
Add 0.5 to the cursor position to be in the middle.
2022-08-31 10:56:52 +02:00
christoph-heinrich
f363879f04 fix: hovered time didn't use correct time (#151)
It didn't just show the wrong time when hovering, but also the wrong
chapter when close to a transition.
2022-08-31 09:22:43 +02:00
tomasklaen
9fbc64889c fix: total time being scaled with speed
closes #149
2022-08-31 08:41:50 +02:00
tomasklaen
9bfa8a5e66 refactor: swap icons to google's material icons font
ref #147
2022-08-30 23:18:07 +02:00
christoph-heinrich
f0a4b34635 fix: timeline progress smoothness and blurring (#145)
* Don't clip incomplete pixels on background
* Render background in parts instead of clipping for foreground
2022-08-30 21:55:27 +02:00
christoph-heinrich
65b82f8be9 fix: progress line x coordinate ignoring window border (#146) 2022-08-30 20:26:38 +02:00
tomasklaen
92b346ae28 refactor: use self functions 2022-08-30 17:06:05 +02:00
tomasklaen
4365f78e46 refactor: move ass_opacity to assdraw extensions 2022-08-30 16:24:41 +02:00
tomasklaen
804faf9e01 refactor!: use icon font to render icons 2022-08-30 16:24:14 +02:00