Move dragbar to the top of element picker dialog

Also fine-tuning CSS for small screen displays.

Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/871
This commit is contained in:
Raymond Hill 2024-03-01 11:55:18 -05:00
parent 7b290e99ab
commit 953c978d59
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 19 additions and 19 deletions

View File

@ -17,24 +17,24 @@ html#ublock0-epicker,
box-sizing: border-box; box-sizing: border-box;
cursor: default; cursor: default;
display: none; display: none;
max-height: calc(100vh - 4px); flex-direction: column;
max-width: 36rem; max-width: min(32rem, 100vw - 4px);
min-width: 24rem; min-width: min(24rem, 100vw - 4px);
overflow-y: auto; overflow-y: auto;
padding: 4px;
position: fixed; position: fixed;
right: 2px; right: 2px;
width: calc(40% - 2px); width: min(32rem, 100vw - 4px);
}
/* https://github.com/uBlockOrigin/uBlock-issues/discussions/2114 */
#ublock0-epicker aside {
min-width: min(24rem, 100vw - 4px);
} }
#ublock0-epicker.paused:not(.zap) aside { #ublock0-epicker.paused:not(.zap) aside {
display: block; display: flex;
} }
#ublock0-epicker aside > *:not(:first-child) {
padding: 2px;
}
#ublock0-epicker #toolbar { #ublock0-epicker #toolbar {
display: flex; display: flex;
justify-content: space-between;
} }
#ublock0-epicker ul { #ublock0-epicker ul {
margin: 0.25em 0 0 0; margin: 0.25em 0 0 0;
@ -46,8 +46,8 @@ html#ublock0-epicker,
#ublock0-epicker #move { #ublock0-epicker #move {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAFElEQVQI12NgwAfKy8v/M5ANYLoBshgEyQo6H9UAAAAASUVORK5CYII='); background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAFElEQVQI12NgwAfKy8v/M5ANYLoBshgEyQo6H9UAAAAASUVORK5CYII=');
cursor: grab; cursor: grab;
flex-grow: 1; height: 1.5rem;
margin: 2px 4px; margin-bottom: 2px;
opacity: 0.8; opacity: 0.8;
} }
#ublock0-epicker aside.moving #move { #ublock0-epicker aside.moving #move {
@ -70,8 +70,8 @@ html#ublock0-epicker,
#ublock0-epicker section .codeMirrorContainer { #ublock0-epicker section .codeMirrorContainer {
border: none; border: none;
box-sizing: border-box; box-sizing: border-box;
height: 8em; height: 6em;
max-height: 50vh; max-height: min(6em, 10vh);
min-height: 1em; min-height: 1em;
padding: 2px; padding: 2px;
width: 100%; width: 100%;
@ -174,12 +174,9 @@ html#ublock0-epicker,
overflow: hidden; overflow: hidden;
} }
#ublock0-epicker #candidateFilters { #ublock0-epicker #candidateFilters {
max-height: 14em; max-height: min(14em, 20vh);
overflow-y: auto; overflow-y: auto;
} }
#ublock0-epicker #candidateFilters > li:first-of-type {
margin-bottom: 0.5em;
}
#ublock0-epicker .changeFilter > li > span:nth-of-type(1) { #ublock0-epicker .changeFilter > li > span:nth-of-type(1) {
font-weight: bold; font-weight: bold;
} }
@ -187,6 +184,9 @@ html#ublock0-epicker,
font-size: smaller; font-size: smaller;
color: gray; color: gray;
} }
#ublock0-epicker #candidateFilters [data-i18n] {
font-size: 90%;
}
#ublock0-epicker #candidateFilters .changeFilter { #ublock0-epicker #candidateFilters .changeFilter {
list-style-type: none; list-style-type: none;
margin: 0 0 0 1em; margin: 0 0 0 1em;

View File

@ -16,6 +16,7 @@
<body> <body>
<aside> <aside>
<div id="move"></div>
<section> <section>
<div> <div>
<div class="codeMirrorContainer codeMirrorBreakAll cm-theme-override"></div> <div class="codeMirrorContainer codeMirrorBreakAll cm-theme-override"></div>
@ -37,7 +38,6 @@
<div> <div>
<button id="preview" type="button" data-i18n="pickerPreview">_<span class="hover"></span></button> <button id="preview" type="button" data-i18n="pickerPreview">_<span class="hover"></span></button>
</div> </div>
<div id="move"></div>
<div> <div>
<button id="create" type="button" class="preferred" disabled data-i18n="pickerCreate">_<span class="hover"></span></button> <button id="create" type="button" class="preferred" disabled data-i18n="pickerCreate">_<span class="hover"></span></button>
<button id="pick" type="button" data-i18n="pickerPick">_<span class="hover"></span></button> <button id="pick" type="button" data-i18n="pickerPick">_<span class="hover"></span></button>