Skip to content

Commit 4227bd1

Browse files
committed
fix: close icon and pin icon not properly aligned
1 parent b13e3dc commit 4227bd1

2 files changed

Lines changed: 28 additions & 25 deletions

File tree

src/project/WorkingSetView.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,21 @@ define(function (require, exports, module) {
12231223
if ($fileStatusIcon) {
12241224
ViewUtils.toggleClass($fileStatusIcon, "can-close", canClose && !isPinned);
12251225
ViewUtils.toggleClass($fileStatusIcon, "pinned", isPinned);
1226+
1227+
// Update icon content based on state
1228+
if (isPinned) {
1229+
// Show thumbtack for pinned files
1230+
if ($fileStatusIcon.find(".fa-thumbtack").length === 0) {
1231+
$fileStatusIcon.html("<i class='fa-solid fa-thumbtack'></i>");
1232+
}
1233+
} else if (canClose) {
1234+
// Show close icon for unpinned files on hover
1235+
if ($fileStatusIcon.find(".fa-times").length === 0) {
1236+
$fileStatusIcon.html("<i class='fa-solid fa-times'></i>");
1237+
}
1238+
} else {
1239+
$fileStatusIcon.empty();
1240+
}
12261241
}
12271242

12281243
// Handle dirty indicator on RIGHT side

src/styles/brackets.less

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ a, img {
14251425
display: block;
14261426
height: 16px;
14271427
line-height: 15px;
1428-
margin-left: 18px;
1428+
margin-left: 21px;
14291429
padding: 3px 0 3px 0;
14301430

14311431
cursor: default;
@@ -1601,40 +1601,28 @@ a, img {
16011601
}
16021602

16031603
.file-status-icon {
1604-
margin: 0 0 0 8px;
16051604
position: absolute;
1606-
left: 0;
1607-
top: 0;
1608-
1609-
&.can-close:before,
1610-
&.pinned:before {
1611-
.unicode-icon-container;
1612-
color: rgba(255, 255, 255, 0.5);
1613-
}
1614-
1615-
&.can-close:before {
1616-
content: "\00D7";
1617-
line-height: 1.1em;
1618-
}
1605+
left: 8px;
1606+
top: 3px;
1607+
width: 16px;
1608+
height: 16px;
1609+
display: flex;
1610+
align-items: center;
1611+
justify-content: center;
1612+
font-size: 11px;
1613+
color: rgba(255, 255, 255, 0.5);
16191614

1620-
&.can-close:hover:before {
1615+
&:hover {
16211616
color: rgba(255, 255, 255, 0.7);
16221617
}
16231618

1624-
&.can-close:active:before {
1619+
&:active {
16251620
color: rgba(255, 255, 255, 0.3);
16261621
}
16271622

1628-
&.pinned:before {
1629-
content: "\f08d";
1630-
font-family: "Font Awesome 6 Free";
1631-
font-weight: 900;
1623+
&.pinned {
16321624
font-size: 9px;
16331625
}
1634-
1635-
&.pinned:hover:before {
1636-
color: rgba(255, 255, 255, 0.7);
1637-
}
16381626
}
16391627

16401628
.working-set-dirty-indicator {

0 commit comments

Comments
 (0)