Macros: Update styles and icons

This commit is contained in:
Alexey Koshelev
2024-10-29 16:46:47 +03:00
parent 54dc65c69d
commit 36d6dfd881
5 changed files with 34 additions and 12 deletions

View File

@ -157,6 +157,7 @@ define([], function () {
},
renderAfterAceLoaded: function() {
var me = this;
this.btnMacrosRun = new Common.UI.Button({
parentEl: $('#btn-macros-run'),
cls: 'btn-toolbar borders--small',
@ -181,7 +182,7 @@ define([], function () {
'<% } %>',
'</div>',
'<div id="<%= id %>" class="list-item" role="listitem"><%= Common.Utils.String.htmlEncode(name) %></div>',
'<div class="listitem-icon toolbar__icon btn-more-vertical"></div>'
'<div class="listitem-icon toolbar__icon btn-more"></div>'
].join(''))
});
this.listMacros.on('item:add', _.bind(this.onAddListItem, this));
@ -214,6 +215,9 @@ define([], function () {
}).on('click', _.bind(this.onCopyMacros, this)),
]
});
this.ctxMenuMacros.on('hide:after', function() {
me.listMacros.$el.find('.listitem-icon').removeClass('active');
});
if(this._state.isFunctionsSupport) {
this.btnFunctionAdd = new Common.UI.Button({
@ -231,7 +235,7 @@ define([], function () {
itemTemplate: _.template([
'<div class="listitem-autostart"></div>',
'<div id="<%= id %>" class="list-item" role="listitem"><%= Common.Utils.String.htmlEncode(name) %></div>',
'<div class="listitem-icon toolbar__icon btn-more-vertical"></div>'
'<div class="listitem-icon toolbar__icon btn-more"></div>'
].join(''))
});
this.listFunctions.on('item:add', _.bind(this.onAddListItem, this));
@ -255,6 +259,10 @@ define([], function () {
}).on('click', _.bind(this.onCopyFunction, this)),
]
});
this.ctxMenuFunction.on('hide:after', function() {
me.listFunctions.$el.find('.listitem-icon').removeClass('active');
});
}
this.makeDragable();
@ -747,6 +755,7 @@ define([], function () {
var btn = $(event.target);
if (btn && btn.hasClass('listitem-icon')) {
itemView.$el.find('.listitem-icon').addClass('active');
this.openContextMenuMacros(record, event);
}
},
@ -869,6 +878,7 @@ define([], function () {
var btn = $(event.target);
if (btn && btn.hasClass('listitem-icon')) {
itemView.$el.find('.listitem-icon').addClass('active');
this.openContextMenuFunction(record, event);
}
},

View File

@ -22,17 +22,15 @@
#menu_macros {
height: 50%;
padding: 5px;
}
#menu_functions {
height: 50%;
padding: 5px;
}
.menu_header {
height: 26px;
margin: 11px 0 8px 6px;
margin: 16px 12px 16px 12px;
display: flex;
justify-content: space-between;
align-items: center;
@ -48,7 +46,8 @@
}
}
#list-macros, #list-functions {
height: calc(100% - 45px);
height: calc(100% - 58px);
padding: 2px 4px 4px 4px;
.listview {
border: none;
@ -57,7 +56,7 @@
position: relative;
align-items: center;
justify-content: space-between;
padding: 2px 10px 2px 2px;
padding: 4px 8px 4px 0px;
margin: 2px 0;
border: none;
cursor: default;
@ -85,8 +84,8 @@
}
.listitem-autostart {
font-size: 10px;
width: 20px;
font-size: 9px;
width: 16px;
text-align: center;
}
@ -103,6 +102,17 @@
height: 20px;
width: 20px;
line-height: 20px;
border-radius: 2px;
&.active {
background-color: @highlight-button-pressed-hover;
}
}
&.selected {
.listitem-icon {
background-position-x: @button-small-active-icon-offset-x;
}
}
}
}
@ -198,6 +208,8 @@
width: 100%;
max-width: 100%;
bottom: 0;
left: 0 !important;
top: initial !important;
.Ace-Tern-tooltip-boxclose {
color: @icon-normal !important;

View File

@ -269,7 +269,7 @@ define([
this.btnMacros = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-big-menu-navigation',
iconCls: 'toolbar__icon btn-macros',
lock: [_set.lostConnect, _set.disableOnStart],
caption: this.textMacros,
enableToggle: true,

View File

@ -386,7 +386,7 @@ define([
this.btnMacros = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-big-menu-navigation',
iconCls: 'toolbar__icon btn-macros',
lock: [_set.lostConnect, _set.disableOnStart],
caption: this.textMacros,
enableToggle: true,

View File

@ -387,7 +387,7 @@ define([
this.btnMacros = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-big-menu-navigation',
iconCls: 'toolbar__icon btn-macros',
lock: [_set.lostConnect, _set.disableOnStart],
caption: this.textMacros,
enableToggle: true,