Skip to content

Commit

Permalink
FileManager: set custom DropDown width for Material theme (#25934)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
iBat and Alexander Bulychev authored Oct 31, 2023
1 parent 27b71ae commit cb25247
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions 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, isMaterial } from '../themes';

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

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

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

return {
cssClass: FILE_MANAGER_TOOLBAR_VIEWMODE_ITEM_CLASS,
Expand All @@ -389,9 +397,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 cb25247

Please sign in to comment.