feat: add menu item role palette
and header
(#45538)
* feat: add menu item role `palette` and `header` * adds comments * refactors new role items to new item types * docs: custom type * docs: note types only available on mac 14+ --------- Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
This commit is contained in:
parent
2248de847d
commit
b9b96a96f7
10 changed files with 61 additions and 8 deletions
|
@ -37,6 +37,18 @@ std::u16string ElectronMenuModel::GetToolTipAt(size_t index) {
|
|||
return iter == std::end(toolTips_) ? std::u16string() : iter->second;
|
||||
}
|
||||
|
||||
void ElectronMenuModel::SetCustomType(size_t index,
|
||||
const std::u16string& customType) {
|
||||
int command_id = GetCommandIdAt(index);
|
||||
customTypes_[command_id] = customType;
|
||||
}
|
||||
|
||||
std::u16string ElectronMenuModel::GetCustomTypeAt(size_t index) {
|
||||
const int command_id = GetCommandIdAt(index);
|
||||
const auto iter = customTypes_.find(command_id);
|
||||
return iter == std::end(customTypes_) ? std::u16string() : iter->second;
|
||||
}
|
||||
|
||||
void ElectronMenuModel::SetRole(size_t index, const std::u16string& role) {
|
||||
int command_id = GetCommandIdAt(index);
|
||||
roles_[command_id] = role;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue