Skip to content

Commit

Permalink
FileManager: set custom DropDown width for Material and Fluent themes (
Browse files Browse the repository at this point in the history
…#25915)

Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
iBat and Alexander Bulychev authored Oct 31, 2023
1 parent 131137d commit 1083f54
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/devextreme/js/ui/file_manager/ui.file_manager.toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { isDefined, isString } from '../../core/utils/type';
import { ensureDefined } from '../../core/utils/common';
import messageLocalization from '../../localization/message';
import { extendAttributes } from './ui.file_manager.common';
import { isCompact, isFluent, isMaterial } from '../themes';

import Widget from '../widget/ui.widget';
import Toolbar from '../toolbar';
Expand Down Expand Up @@ -376,6 +377,15 @@ class FileManagerToolbar extends Widget {
});

const selectedIndex = this.option('itemViewMode') === 'thumbnails' ? 1 : 0;
const dropDownOptions = {
container: this._$viewSwitcherPopup
};

if(isMaterial()) {
dropDownOptions.width = isCompact() ? 28 : 36;
} else if(isFluent()) {
dropDownOptions.width = isCompact() ? 34 : 40;
}

return {
cssClass: FILE_MANAGER_TOOLBAR_VIEWMODE_ITEM_CLASS,
Expand All @@ -389,9 +399,7 @@ class FileManagerToolbar extends Widget {
stylingMode: 'text',
showArrowIcon: false,
useSelectMode: true,
dropDownOptions: {
container: this._$viewSwitcherPopup
},
dropDownOptions,
onItemClick: e => this._executeCommand(e.itemData.name)
}
};
Expand Down

0 comments on commit 1083f54

Please sign in to comment.