Skip to content

Commit 3dd5ee9

Browse files
committed
Use 128x128 icon in About window for all themes
- Use 128x128 icon size for themes other than Bubblegum, so the layout matches between themes, and it's easier to maintain. - This also fixes the icon overlapping text content in the Bubblegum theme at small window sizes. - (This also makes it look nicer when app name and version wrap to below the icon, due to a narrow viewport, as the text now looks centered below the icon, at least for me, on Chrome and Firefox on Windows 11. That said, it's dependent on the font metrics, not properly centered.)
1 parent 438a5a1 commit 3dd5ee9

6 files changed

Lines changed: 13 additions & 21 deletions

File tree

cypress/integration/visual-tests.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ context('visual tests', () => {
197197
it('about window', () => {
198198
clickMenuButton('Help');
199199
clickMenuItem('About Paint');
200-
waitForImage('#paint-32x32');
200+
waitForImage('#about-paint-icon');
201201
cy.get('.window:visible').matchImageSnapshot(Object.assign({}, withMuchTextCompareOptions, { blackout: ["#maybe-outdated-line", "#jspaint-version"] }));
202202
});
203203

@@ -278,7 +278,7 @@ context('visual tests', () => {
278278
it('bubblegum theme -- about window', () => {
279279
clickMenuButton('Help');
280280
clickMenuItem('About Paint');
281-
// waitForImage('#paint-32x32'); // it's actually replaced with a background image in this theme
281+
// waitForImage('#about-paint-icon'); // it's actually replaced with a background image in this theme
282282
// waitForRequest("/images/bubblegum/bubblegum-paint-128x128.png", () => { // not working
283283
// waitForRequest("**/bubblegum-paint-*.png", () => { // not working
284284
cy.wait(1000); // wait and hope it's loaded

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<body>
7878
<div id="about-paint" style="display: none">
7979
<h1 id="about-paint-header">
80-
<img src="images/icons/32x32.png" width="32" height="32" id="paint-32x32" alt="" />
80+
<img src="images/icons/128x128.png" width="128" height="128" id="about-paint-icon" alt="" />
8181
<div id="jspaint-project-name-and-version">
8282
<div id="jspaint-project-name">JS Paint</div>
8383
<div id="jspaint-version" title="About time to increment the version number, don't you think?">

src/functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ function show_about_paint() {
15601560
});
15611561
$about_paint_window.addClass("about-paint squish");
15621562
if (is_pride_month) {
1563-
$("#paint-32x32").attr("src", "./images/icons/gay-es-paint-32x32-light-outline.png");
1563+
$("#about-paint-icon").attr("src", "./images/icons/gay-es-about-paint-icon-light-outline.png");
15641564
}
15651565

15661566
$about_paint_window.$content.append($about_paint_content.show()).css({ padding: "15px" });

styles/layout.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,12 +969,14 @@ input[type="radio"] + label::before {
969969
flex-direction: row;
970970
flex-wrap: wrap;
971971
margin: 0;
972-
margin-top: 30px;
972+
margin-top: 10px;
973973
margin-bottom: 10px;
974974
}
975975
#jspaint-project-name-and-version {
976976
margin-left: 10px;
977977
white-space: nowrap;
978+
margin: auto;
979+
margin-left: 10px;
978980
}
979981
#jspaint-version {
980982
/* @TODO: separate some of this into a shared.css? (not all layout!) */

styles/layout.rtl.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,12 +969,14 @@ input[type="radio"] + label::before {
969969
flex-direction: row;
970970
flex-wrap: wrap;
971971
margin: 0;
972-
margin-top: 30px;
972+
margin-top: 10px;
973973
margin-bottom: 10px;
974974
}
975975
#jspaint-project-name-and-version {
976976
margin-right: 10px;
977977
white-space: nowrap;
978+
margin: auto;
979+
margin-right: 10px;
978980
}
979981
#jspaint-version {
980982
/* @TODO: separate some of this into a shared.css? (not all layout!) */

styles/themes/bubblegum.css

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,26 +161,14 @@ button:active {
161161
}
162162

163163
/* About window */
164-
#maybe-outdated-view-project-news {
165-
/* Make room for enlarged icon */
166-
margin-left: 120px;
167-
}
168-
#paint-32x32 {
169-
/* Replace and enlarge icon */
164+
#about-paint-icon {
165+
/* Replace icon */
170166
display: block;
171167
-moz-box-sizing: border-box;
172168
box-sizing: border-box;
173169
background: url("../../images/bubblegum/bubblegum-paint-128x128.png") no-repeat;
174-
/* background-size: 32px 32px;
175-
width: 32px;
176-
height: 32px;
177-
padding-left: 32px; */
178-
background-size: 128px 128px;
179-
width: 128px;
180-
height: 128px;
170+
background-size: 100% 100%;
181171
padding-left: 128px;
182-
transform: translateY(-40px);
183-
margin-bottom: calc(32px - 128px);
184172
}
185173

186174
/* Need multiple specificity levels to override Modern theme. */

0 commit comments

Comments
 (0)