opt: use link instead of button and tooltip

This commit is contained in:
YiFang Xiao 2023-12-20 15:04:57 +08:00
parent 17d46fcac1
commit b5a1192cfd
6 changed files with 1 additions and 57 deletions

View file

@ -250,11 +250,6 @@ std::string ArticleMaker::makeNotFoundBody( QString const & word, QString const
string ArticleMaker::makeWelcomeHtml() const string ArticleMaker::makeWelcomeHtml() const
{ {
string result = makeHtmlHeader( tr( "Welcome!" ), QString(), cfg.alwaysExpandOptionalParts ); string result = makeHtmlHeader( tr( "Welcome!" ), QString(), cfg.alwaysExpandOptionalParts );
//tooltip
result += R"(<script src="qrc:///scripts/popper.min.js"></script>)";
result += R"(<script src="qrc:///scripts/tippy.min.js"></script>)";
result += R"(<link href="qrc:///tippy-light.css" rel="stylesheet">)";
result += result +=
tr( tr(
@ -262,7 +257,7 @@ string ArticleMaker::makeWelcomeHtml() const
"<p>To start working with the program, first visit <b>Edit|Dictionaries</b> to add some directory paths where to search " "<p>To start working with the program, first visit <b>Edit|Dictionaries</b> to add some directory paths where to search "
"for the dictionary files, set up various Wikipedia sites or other sources, adjust dictionary order or create dictionary groups." "for the dictionary files, set up various Wikipedia sites or other sources, adjust dictionary order or create dictionary groups."
"<p>And then you're ready to look up your words! You can do that in this window " "<p>And then you're ready to look up your words! You can do that in this window "
"by using a pane to the left, or you can <button id=\"lookup-popup\">look up words from other active applications</button>. " "by using a pane to the left, or you can <a href=\"https://xiaoyifang.github.io/goldendict-ng/ui_popup/\">look up words from other active applications</a>. "
"<p>To customize program, check out the available preferences at <b>Edit|Preferences</b>. " "<p>To customize program, check out the available preferences at <b>Edit|Preferences</b>. "
"All settings there have tooltips, be sure to read them if you are in doubt about anything." "All settings there have tooltips, be sure to read them if you are in doubt about anything."
"<p>Should you need further help, have any questions, " "<p>Should you need further help, have any questions, "
@ -302,19 +297,6 @@ string ArticleMaker::makeWelcomeHtml() const
theme = "light"; theme = "light";
} }
result += QString(
R"(<script>
const template = document.getElementById('popup');
tippy('#lookup-popup', {
content: template.innerHTML,
allowHTML: true,
theme: '%1'
});
</script>)" )
.arg( theme )
.toStdString();
result += "</body></html>"; result += "</body></html>";
return result; return result;

File diff suppressed because one or more lines are too long

View file

@ -7,8 +7,6 @@
<file>iframeResizer.contentWindow.min.js</file> <file>iframeResizer.contentWindow.min.js</file>
<file>iframeResizer.min.js</file> <file>iframeResizer.min.js</file>
<file>jquery-3.6.0.slim.min.js</file> <file>jquery-3.6.0.slim.min.js</file>
<file>popper.min.js</file>
<file>tippy.min.js</file>
<file>mark.min.js</file> <file>mark.min.js</file>
</qresource> </qresource>
</RCC> </RCC>

File diff suppressed because one or more lines are too long

View file

@ -17,6 +17,5 @@
<file>qt-style-win.css</file> <file>qt-style-win.css</file>
<file>qt-style.css</file> <file>qt-style.css</file>
<file>article-style-darkmode.css</file> <file>article-style-darkmode.css</file>
<file>tippy-light.css</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -1,27 +0,0 @@
.tippy-box[data-theme~="light"] {
color: #26323d;
box-shadow:
0 0 20px 4px rgba(154, 161, 177, 0.15),
0 4px 80px -8px rgba(36, 40, 47, 0.25),
0 4px 4px -2px rgba(91, 94, 105, 0.15);
background-color: #fff;
}
.tippy-box[data-theme~="light"][data-placement^="top"] > .tippy-arrow:before {
border-top-color: #fff;
}
.tippy-box[data-theme~="light"][data-placement^="bottom"]
> .tippy-arrow:before {
border-bottom-color: #fff;
}
.tippy-box[data-theme~="light"][data-placement^="left"] > .tippy-arrow:before {
border-left-color: #fff;
}
.tippy-box[data-theme~="light"][data-placement^="right"] > .tippy-arrow:before {
border-right-color: #fff;
}
.tippy-box[data-theme~="light"] > .tippy-backdrop {
background-color: #fff;
}
.tippy-box[data-theme~="light"] > .tippy-svg-arrow {
fill: #fff;
}