Skip to content

Commit

Permalink
feat: show optional authors in gtk about panel
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 24, 2019
1 parent 1304f25 commit d44bda9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/app.md
Expand Up @@ -1180,6 +1180,7 @@ Show the app's about panel options. These options can be overridden with `app.se
* `copyright` String (optional) - Copyright information.
* `version` String (optional) - The app's build version number. _macOS_
* `credits` String (optional) - Credit information. _macOS_
* `authors` String[] (optional) - List of app authors. _Linux_
* `website` String (optional) - The app's website. _Linux_
* `iconPath` String (optional) - Path to the app's icon. _Linux_

Expand Down
9 changes: 9 additions & 0 deletions shell/browser/browser_linux.cc
Expand Up @@ -148,6 +148,7 @@ bool Browser::IsEmojiPanelSupported() {

void Browser::ShowAboutPanel() {
std::string app_name, version, copyright, icon_path, website;
base::ListValue* args;

GtkAboutDialog* dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());

Expand All @@ -159,6 +160,14 @@ void Browser::ShowAboutPanel() {
gtk_about_dialog_set_copyright(dialog, copyright.c_str());
if (about_panel_options_.GetString("website", &website))
gtk_about_dialog_set_website(dialog, website.c_str());
if (about_panel_options_.GetList("args", &args)) {
std::vector<const char*> cstrs;
for (const auto& str : args->GetList()) {
cstrs.push_back(str.c_str());
}
cstrs.push_back(nullptr);
gtk_about_dialog_set_authors(dialog, cstrs.data());
}
if (about_panel_options_.GetString("iconPath", &icon_path)) {
GError* error = nullptr;
GdkPixbuf* icon = gdk_pixbuf_new_from_file(icon_path.c_str(), &error);
Expand Down

0 comments on commit d44bda9

Please sign in to comment.