* Updated events to be more specific * Update more events * Update globalmousepos * Update themes and submap module to show submap name. * Type fixes * Reworked menu position calculation logic to be much more efficient. * Revert import file location * We luv arrow functions * Remove globalMousePos remnants since it's unused. * Added the ability to configure menu dropdown transition and duration. * Fix type
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import DropdownMenu from 'modules/menus/shared/dropdown/index';
|
|
import { TimeWidget } from './time/index';
|
|
import { CalendarWidget } from './calendar';
|
|
import { WeatherWidget } from './weather/index';
|
|
import options from 'options';
|
|
import Window from 'types/widgets/window';
|
|
import { Attribute, Child } from 'lib/types/widget';
|
|
|
|
const { enabled: weatherEnabled } = options.menus.clock.weather;
|
|
|
|
export default (): Window<Child, Attribute> => {
|
|
return DropdownMenu({
|
|
name: 'calendarmenu',
|
|
transition: options.menus.transition.bind('value'),
|
|
child: Widget.Box({
|
|
class_name: 'calendar-menu-content',
|
|
css: 'padding: 1px; margin: -1px;',
|
|
vexpand: false,
|
|
children: [
|
|
Widget.Box({
|
|
class_name: 'calendar-content-container',
|
|
vertical: true,
|
|
children: [
|
|
Widget.Box({
|
|
class_name: 'calendar-content-items',
|
|
vertical: true,
|
|
children: weatherEnabled.bind('value').as((isWeatherEnabled) => {
|
|
return [TimeWidget(), CalendarWidget(), ...(isWeatherEnabled ? [WeatherWidget()] : [])];
|
|
}),
|
|
}),
|
|
],
|
|
}),
|
|
],
|
|
}),
|
|
});
|
|
};
|