fix: display media total length on bar and add a time label (#435)
* fix: display media total length on bar * fix: add option to display custom nomedia text * feat: add dedicated label too * fix: media add more window names for playables * fix: add option to control display time * Consolidate code and make tooltip timestamp for media bar opt-in. --------- Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
28
modules/menus/media/components/timelabel/index.ts
Normal file
28
modules/menus/media/components/timelabel/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { BoxWidget } from 'lib/types/widget';
|
||||
import { getPlayerInfo } from '../helpers';
|
||||
import { updateTimestamp } from '../timebar/helpers';
|
||||
|
||||
const Time = (): BoxWidget => {
|
||||
return Widget.Box({
|
||||
class_name: 'media-indicator-current-time-label',
|
||||
hexpand: true,
|
||||
children: [
|
||||
Widget.Box({
|
||||
hexpand: true,
|
||||
child: Widget.Label({
|
||||
hexpand: true,
|
||||
tooltip_text: '--',
|
||||
class_name: 'time-label',
|
||||
setup: (self) => {
|
||||
self.poll(1000, () => {
|
||||
const foundPlayer = getPlayerInfo();
|
||||
updateTimestamp(self, foundPlayer);
|
||||
});
|
||||
},
|
||||
}),
|
||||
}),
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
export { Time };
|
||||
Reference in New Issue
Block a user