Skip to content
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

feat: get more themes button in themes dialog for discoverability #1852

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/verify_cla_signature_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
env:
EMPLOYER_CLA_LINK: https://raw.githubusercontent.com/phcode-dev/contributor-license-agreement/main/employer_contributor_license_agreement.md
PERSONAL_CLA_LINK: https://raw.githubusercontent.com/phcode-dev/contributor-license-agreement/main/personal_contributor_licence_agreement.md
- uses: actions/upload-artifact@v2

- uses: actions/upload-artifact@v4
with:
name: prcontext
path: .tmp/
Expand Down
6 changes: 5 additions & 1 deletion src/extensibility/ExtensionManagerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ define(function (require, exports, module) {
* @private
* Show a dialog that allows the user to browse and manage extensions.
*/
function _showDialog() {
function _showDialog(which) {
Metrics.countEvent(Metrics.EVENT_TYPE.EXTENSIONS, "dialogue", "shown");

let dialog,
Expand Down Expand Up @@ -422,6 +422,10 @@ define(function (require, exports, module) {
InstallExtensionDialog.showDialog().done(ExtensionManager.updateFromDownload);
});

if(which === "themes"){
$dlg.find(".nav-tabs a.themes").click();
}

return new $.Deferred().resolve(dialog).promise();
}

Expand Down
1 change: 1 addition & 0 deletions src/htmlContent/themes-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1 class="dialog-title">{{Strings.THEMES_SETTINGS}}</h1>
<option style="text-align:left;" value="{{name}}" data-target="theme">{{displayName}}</option>
{{/themes}}
</select>
<button class="btn get-more-themes">{{Strings.GET_MORE_THEMES}}</button>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ define({

// Strings for themes-settings.html and themes-general.html
"CURRENT_THEME": "Current Theme",
"GET_MORE_THEMES": "Get More...",
"USE_THEME_SCROLLBARS": "Use Theme Scrollbars",
"FONT_SIZE": "Font Size",
"FONT_FAMILY": "Font Family",
Expand Down
13 changes: 12 additions & 1 deletion src/view/ThemeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ define(function (require, exports, module) {
ViewCommandHandlers = require("view/ViewCommandHandlers"),
settingsTemplate = require("text!htmlContent/themes-settings.html"),
PreferencesManager = require("preferences/PreferencesManager"),
CommandManager = require("command/CommandManager"),
Commands = require("command/Commands"),
prefs = PreferencesManager.getExtensionPrefs("themes");

/**
Expand Down Expand Up @@ -140,7 +142,8 @@ define(function (require, exports, module) {
}
});

Dialogs.showModalDialogUsingTemplate($template).done(function (id) {
const dialog = Dialogs.showModalDialogUsingTemplate($template);
dialog.done(function (id) {
var setterFn;

if (id === "save") {
Expand All @@ -162,6 +165,14 @@ define(function (require, exports, module) {
prefs.set("theme", currentSettings.theme);
}
});
$template
.find(".get-more-themes")
.click(function (event) {
event.preventDefault();
event.stopPropagation();
dialog.close();
CommandManager.execute(Commands.FILE_EXTENSION_MANAGER, "themes");
});
}

/**
Expand Down
Loading