-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[editor] Add some UI elements in order to set font size & color, and ink thickness & color #15039
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not really had time to test this yet, but I've added a few comments based on an initial look at the code.
While this seems mostly reasonable, there's a couple of things (e.g. related to the Toolbar-positions of the buttons) that we need to fix here.
web/viewer.css
Outdated
#editorParamsToolbarContainer .editorParamsSlider::-moz-range-progress { | ||
background-color: black; | ||
} | ||
#editorParamsToolbarContainer .editorParamsSlider::-moz-range-track { | ||
background-color: black; | ||
} | ||
#editorParamsToolbarContainer .editorParamsSlider::-moz-range-thumb { | ||
background-color: white; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these not available as standard CSS features instead (since it won't work in the GENERIC viewer)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to leave these enabled everywhere though, such that the GENERIC viewer works better when used standalone in Firefox.
I was mostly wondering if there's anything similar for other browsers; sorry if that wasn't clear.
9002d3c
to
79d78f6
Compare
I'll try to review this PR during the weekend, since the size/scope of the changes means that it takes a little time to try and understand everything here; sorry about the delay! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to create a preview to play with this a little bit, and to see how the new CSS-rules behave, however it needs a rebase first for that to work.
@@ -89,6 +95,94 @@ class FreeTextEditor extends AnnotationEditor { | |||
return editor; | |||
} | |||
|
|||
static updateDefaultParams(type, value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to update the default values, and not just the values for the current instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure either it's a good idea: we need to know what UX thinks about that.
Anyway it works like this in Acrobat.
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/486fa915e784836/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/486fa915e784836/output.txt Total script time: 2.76 mins Published |
web/viewer.css
Outdated
padding-inline: 12px; | ||
} | ||
|
||
#editorParamsToolbarContainer .editorParamsLabel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These labels are almost invisible in the "light"-CSS viewer mode.
Similar to the regular toolbarLabel
-class, you'll definitely need to add the following rule here as well:
color: var(--main-color);
web/viewer.html
Outdated
@@ -147,6 +147,32 @@ | |||
</div> | |||
</div> <!-- findbar --> | |||
|
|||
<div class="editorParamsToolbar hidden doorHangerRight" id="editorFreeTextParamsToolbar"> | |||
<div id="editorParamsToolbarContainer"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're adding the same id for two different elements here, which feels strange.
What you probably want, here and below, is to use a class-name instead:
<div id="editorParamsToolbarContainer"> | |
<div class="editorParamsToolbarContainer"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remember to make the same changes throughout the CSS-code as well.
web/viewer.html
Outdated
</div> | ||
|
||
<div class="editorParamsToolbar hidden doorHangerRight" id="editorInkParamsToolbar"> | ||
<div id="editorParamsToolbarContainer"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div id="editorParamsToolbarContainer"> | |
<div class="editorParamsToolbarContainer"> |
web/viewer.css
Outdated
padding: 6px 0 10px; | ||
inset-inline-end: 4px; | ||
height: auto; | ||
z-index: 30000; | ||
background-color: var(--doorhanger-bg-color); | ||
} | ||
|
||
#editorParamsToolbarContainer > .editorParamsSetter { | ||
max-width: 220px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding it slightly inconsistent that the width of the two new toolbars aren't consistent.
So, can we perhaps remove this line, and instead add the following just above?
.editorParamsToolbarContainer {
width: 220px;
margin-bottom: -4px;
}
(The second line again follows the secondaryToolbar code, to get consitent top/bottom margins.)
web/viewer.html
Outdated
<input type="color" id="editorFreeTextColor" name="fontColor" class="editorParamsColor" tabindex="100"> | ||
<label for="fontColor" class="editorParamsLabel" data-l10n-id="editor_free_text_font_color">Font Color</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it, perhaps, look better with the order of the labels/inputs flipped?
web/viewer.css
Outdated
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding-inline: 12px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, do we perhaps want to reduce this a little bit (e.g. to 10px
)?
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/fd81324e58f9554/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/fd81324e58f9554/output.txt Total script time: 2.63 mins Published |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, with the last round of comments addressed; thank you!
web/viewer.html
Outdated
<input type="color" id="editorInkColor" name="inkColor" class="editorParamsColor" tabindex="102"> | ||
<label for="color" class="editorParamsLabel" data-l10n-id="editor_ink_line_color">Line Color</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's flip the order of these elements as well, for consistency with the FreeText-toolbar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for your information, I copied/pasted this code from:
Lines 131 to 136 in 4e025e1
<div id="findbarOptionsOneContainer"> | |
<input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94"> | |
<label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight All</label> | |
<input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95"> | |
<label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match Case</label> | |
</div> |
where it's
input, label
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, however please note that in those cases only the label
is actually visible; hence it's a slightly different situation :-)
web/viewer.html
Outdated
<input type="range" id="editorInkThickness" class="editorParamsSlider" name="lineThickness" value="1" min="1" max="20" step="1" tabindex="103"> | ||
<label for="lineThickness" class="editorParamsLabel" data-l10n-id="editor_ink_line_thickness">Line Thickness</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's flip the order of these elements as well, for consistency with the FreeText-toolbar.
web/viewer.html
Outdated
<label for="fontColor" class="editorParamsLabel" data-l10n-id="editor_free_text_font_color">Font Color</label> | ||
<input type="color" id="editorFreeTextColor" name="fontColor" class="editorParamsColor" tabindex="100"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the for
-attribute reference the input-id
in order to work correctly?
Basically, I believe that you want the following (with similar changes for the new elements below):
<label for="fontColor" class="editorParamsLabel" data-l10n-id="editor_free_text_font_color">Font Color</label> | |
<input type="color" id="editorFreeTextColor" name="fontColor" class="editorParamsColor" tabindex="100"> | |
<label for="editorFreeTextColor" class="editorParamsLabel" data-l10n-id="editor_free_text_font_color">Font Color</label> | |
<input type="color" id="editorFreeTextColor" class="editorParamsColor" tabindex="100"> |
web/viewer.css
Outdated
} | ||
|
||
.editorParamsToolbarContainer .editorParamsLabel { | ||
padding-inline-start: 10px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be changed to padding-inline-end
now?
…ink thickness & color
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/88fd07bb59f7dad/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/534c35c559dca77/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/88fd07bb59f7dad/output.txt Total script time: 26.53 mins
Image differences available at: http://54.241.84.105:8877/88fd07bb59f7dad/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/534c35c559dca77/output.txt Total script time: 28.41 mins
Image differences available at: http://54.193.163.58:8877/534c35c559dca77/reftest-analyzer.html#web=eq.log |
The "regressions" in ref tests are because I changed the linecap, hence they're acceptable. |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/7919825f1ca22cc/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.193.163.58:8877/b17a0e005f4040b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/7919825f1ca22cc/output.txt Total script time: 22.64 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/b17a0e005f4040b/output.txt Total script time: 22.50 mins
|
No description provided.