Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 2ccdb42

Browse files
committed
Merge pull request #9149 from adobe/randy/issues-9137-9143
Hide Options button when Working Set hidden
2 parents 60198e2 + e407702 commit 2ccdb42

2 files changed

Lines changed: 31 additions & 8 deletions

File tree

src/project/SidebarView.js

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,25 @@ define(function (require, exports, module) {
116116
}
117117

118118
/**
119-
* Update state of splitview button icon and menu checkmarks
119+
* Update state of working set
120120
* @private
121121
*/
122-
function _updateSplitViewButtonState() {
122+
function _updateWorkingSetState() {
123+
if (MainViewManager.getPaneCount() === 1 &&
124+
MainViewManager.getWorkingSetSize(MainViewManager.ACTIVE_PANE) === 0) {
125+
$workingSetViewsContainer.hide();
126+
$gearMenu.hide();
127+
} else {
128+
$workingSetViewsContainer.show();
129+
$gearMenu.show();
130+
}
131+
}
132+
133+
/**
134+
* Update state of splitview and option elements
135+
* @private
136+
*/
137+
function _updateUIStates() {
123138
var ypos, spriteIndex,
124139
layoutScheme = MainViewManager.getLayoutScheme();
125140

@@ -131,14 +146,17 @@ define(function (require, exports, module) {
131146
spriteIndex = 0;
132147
}
133148

134-
// Icon
149+
// SplitView Icon
135150
ypos = SPRITE_BASE - (spriteIndex * SPRITE_OFFSET);
136151
$splitViewMenu.css("background-position-y", ypos);
137152

138-
// Menu
153+
// SplitView Menu
139154
_cmdSplitNone.setChecked(spriteIndex === 0);
140155
_cmdSplitVertical.setChecked(spriteIndex === 1);
141156
_cmdSplitHorizontal.setChecked(spriteIndex === 2);
157+
158+
// Options icon
159+
_updateWorkingSetState();
142160
}
143161

144162
/**
@@ -226,15 +244,19 @@ define(function (require, exports, module) {
226244
});
227245

228246
$(MainViewManager).on("paneLayoutChange", function () {
229-
_updateSplitViewButtonState();
247+
_updateUIStates();
248+
});
249+
250+
$(MainViewManager).on("workingSetAdd workingSetAddList workingSetRemove workingSetRemoveList workingSetUpdate", function () {
251+
_updateWorkingSetState();
230252
});
231253

232254
// create WorkingSetViews for each pane already created
233255
_.forEach(MainViewManager.getPaneIdList(), function (paneId) {
234256
WorkingSetView.createWorkingSetViewForPane($workingSetViewsContainer, paneId);
235257
});
236258

237-
_updateSplitViewButtonState();
259+
_updateUIStates();
238260

239261
// Tooltips
240262
$gearMenu.attr("title", Strings.GEAR_MENU_TOOLTIP);

src/styles/brackets.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ a, img {
709709

710710
.working-set-option-btn {
711711
position: absolute;
712-
right: 4px;
712+
right: 30px;
713713
top: 7px;
714714
padding: 4px 6px;
715715
.sprite-icon(0, 0, 13px, 13px, "images/topcoat-settings-13.svg");
@@ -720,12 +720,13 @@ a, img {
720720

721721
.working-set-splitview-btn {
722722
position: absolute;
723-
right: 30px;
723+
right: 4px;
724724
top: 7px;
725725
padding: 4px 6px;
726726
.sprite-icon(0, 0, 13px, 13px, "images/split-view-icons.svg");
727727
background-position: center 5px;
728728
z-index: 1;
729+
-webkit-filter: drop-shadow(0 1px 0 rgba(0,0,0,0.36));
729730
}
730731

731732
#sidebar {

0 commit comments

Comments
 (0)