style/global menu: improve the full screen / zoom buttons, refactor

This commit is contained in:
Adorian Doran
2025-09-21 15:13:08 +03:00
parent 5c27e96960
commit 6f565afd44
5 changed files with 25 additions and 20 deletions

View File

@@ -84,6 +84,7 @@ interface FormListItemOpts {
disabled?: boolean;
checked?: boolean | null;
selected?: boolean;
container?: boolean;
onClick?: (e: MouseEvent) => void;
triggerCommand?: CommandNames;
description?: string;
@@ -96,7 +97,7 @@ const TOOLTIP_CONFIG: Partial<Tooltip.Options> = {
fallbackPlacements: [ "right" ]
}
export function FormListItem({ className, icon, value, title, active, disabled, checked, onClick, selected, rtl, triggerCommand, description, ...contentProps }: FormListItemOpts) {
export function FormListItem({ className, icon, value, title, active, disabled, checked, container, onClick, selected, rtl, triggerCommand, description, ...contentProps }: FormListItemOpts) {
const itemRef = useRef<HTMLLIElement>(null);
if (checked) {
@@ -108,9 +109,9 @@ export function FormListItem({ className, icon, value, title, active, disabled,
return (
<li
ref={itemRef}
class={`dropdown-item ${active ? "active" : ""} ${disabled ? "disabled" : ""} ${selected ? "selected" : ""} ${className ?? ""}`}
class={`dropdown-item ${active ? "active" : ""} ${disabled ? "disabled" : ""} ${selected ? "selected" : ""} ${container ? "dropdown-container-item": ""} ${className ?? ""}`}
data-value={value} title={title}
tabIndex={0}
tabIndex={container ? -1 : 0}
onClick={onClick}
data-trigger-command={triggerCommand}
dir={rtl ? "rtl" : undefined}