Implemented menu separators and disabled items.

Separators are for the main menu, disabled items are for main and game
menus. As part of this, the disabled menu items' titles are no longer
set. Also moved a few main menu items around.
This commit is contained in:
Oliver Hamlet
2014-11-10 12:11:54 +00:00
parent 51dbbcd50f
commit 8008615b04
3 changed files with 24 additions and 11 deletions
+18 -3
View File
@@ -20,6 +20,21 @@
color: black;
}
/* This override adds separator menu items. */
html /deep/ paper-item[separator] {
height: 1px;
min-height: 1px;
margin: 10px 0;
background: #CECECE;
pointer-events: none;
}
/* This override disable menu items. */
html /deep/ paper-item[disabled] {
opacity: 0.6 !important;
pointer-events: none;
}
/* These overrides change the colour of the tab ink effect and their underline. */
paper-tabs::shadow #selectionBar {
background-color: #4285f4;
@@ -28,17 +43,17 @@ paper-tab::shadow #ink {
color: #4285f4;
}
/* These overrides change the font size of the sidebar items to be the body text size. */
/* This override change the font size of the sidebar items to be the body text size. */
#cardsNav /deep/ #label {
font-size: 10pt;
}
/* These overrides change the position of the link in <loot-plugin-item> so that it doesn't cover up tooltips. */
/* This override change the position of the link in <loot-plugin-item> so that it doesn't cover up tooltips. */
loot-plugin-item::shadow ::content > a {
left: 112px;
}
/* These overrides change the positioning of the progress dialog to adapt to content changes. */
/* This override change the positioning of the progress dialog to adapt to content changes. */
#progressDialog {
position: inherit !important;
margin: auto;
+3 -7
View File
@@ -70,13 +70,11 @@ var loot = {
}
var redateButton = document.getElementById('redatePluginsButton');
if (index != undefined && loot.settings.games[index].type == 'Skyrim') {
redateButton.classList.toggle('disabled', false);
redateButton.title = '';
redateButton.removeAttribute('disabled');
redateButton.removeEventListener('mouseenter', showHoverText, false);
redateButton.removeEventListener('mouseleave', hideHoverText, false);
} else {
redateButton.classList.toggle('disabled', true);
redateButton.title = 'A Skyrim-specific feature';
redateButton.setAttribute('disabled', true);
redateButton.addEventListener('mouseenter', showHoverText, false);
redateButton.addEventListener('mouseleave', hideHoverText, false);
}
@@ -153,13 +151,11 @@ var loot = {
for (var i = 0; i < gameMenuItems.length; ++i) {
if (this.installedGames.indexOf(gameMenuItems[i].getAttribute('value')) == -1) {
gameMenuItems[i].setAttribute('disabled', true);
gameMenuItems[i].title = 'No install detected';
gameMenuItems[i].removeEventListener('click', changeGame, false);
gameMenuItems[i].addEventListener('mouseenter', showHoverText, false);
gameMenuItems[i].addEventListener('mouseleave', hideHoverText, false);
} else {
gameMenuItems[i].removeAttribute('disabled');
gameMenuItems[i].title = '';
gameMenuItems[i].addEventListener('click', changeGame, false);
gameMenuItems[i].removeEventListener('mouseenter', showHoverText, false);
gameMenuItems[i].removeEventListener('mouseleave', hideHoverText, false);
@@ -818,7 +814,7 @@ function cancelSort(evt) {
}).catch(processCefError);
}
function redatePlugins(evt) {
if (evt.target.classList.contains('disabled')) {
if (evt.target.hasAttribute('disabled')) {
return;
}
+3 -1
View File
@@ -42,12 +42,14 @@
<core-toolbar id="mainToolbar">
<paper-menu-button icon="menu">
<paper-item id="redatePluginsButton" icon="today" label="Redate Plugins"></paper-item>
<paper-item id="openLogButton" icon="folder" label="Open Debug Log Location"></paper-item>
<paper-item id="wipeUserlistButton" icon="delete" label="Clear All User Metadata"></paper-item>
<paper-item id="copyContentButton" icon="content-copy" label="Copy Content As Text"></paper-item>
<paper-item id="refreshContentButton" icon="cached" label="Refresh Content"></paper-item>
<paper-item separator></paper-item>
<paper-item id="settingsButton" icon="settings" label="Settings"></paper-item>
<paper-item separator></paper-item>
<paper-item id="helpButton" icon="book" label="View Documentation"></paper-item>
<paper-item id="openLogButton" icon="folder" label="Open Debug Log Location"></paper-item>
<paper-item id="aboutButton" icon="help" label="About"></paper-item>
</paper-menu-button>
<loot-dropdown-menu id="gameMenu">