Skip to content

Commit

Permalink
Apply brave bookmark folder images
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Jan 25, 2022
1 parent e6b00ff commit 1560d3f
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 8 deletions.
4 changes: 4 additions & 0 deletions app/theme/brave_theme_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_LIN_LIGHT" file="common/brave_bookmark_folder_closed-lin-light.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_WIN_DARK" file="common/brave_bookmark_folder_closed-win-dark.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_WIN_LIGHT" file="common/brave_bookmark_folder_closed-win-light.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_OPEN_LIN_DARK" file="common/brave_bookmark_folder_open-lin-dark.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_OPEN_LIN_LIGHT" file="common/brave_bookmark_folder_open-lin-light.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_OPEN_WIN_DARK" file="common/brave_bookmark_folder_open-win-dark.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_BOOKMARK_FOLDER_OPEN_WIN_LIGHT" file="common/brave_bookmark_folder_open-win-light.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_WAYBACK_INFOBAR" file="brave/brave_wayback_infobar.png" />
<structure type="chrome_scaled_image" name="IDR_BRAVE_WAYBACK_INFOBAR_DARK" file="brave/brave_wayback_infobar_dark.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_32_BETA" file="brave/product_logo_32_beta.png" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions browser/resources/sidebar/bookmarks/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import("//tools/polymer/html_to_js.gni")
import("//tools/typescript/ts_library.gni")
import("//ui/webui/resources/tools/generate_grd.gni")

preprocess_folder = "$root_gen_dir/brave/browser/resources/sidebar/bookmarks/preprocessed/bookmarks"
preprocess_folder = "$root_gen_dir/brave/browser/resources/sidebar/bookmarks/preprocessed"

generate_grd("build_grdp") {
grd_prefix = "sidebar_bookmarks"
Expand Down Expand Up @@ -57,7 +57,7 @@ html_to_js("web_components") {

ts_library("build_ts") {
tsconfig_base = "tsconfig_base.json"
root_dir = "$target_gen_dir/preprocessed/bookmarks"
root_dir = "$target_gen_dir/preprocessed"
out_dir = "$target_gen_dir/tsc"
in_files = [
"bookmark_folder.ts",
Expand Down
47 changes: 41 additions & 6 deletions browser/resources/sidebar/bookmarks/bookmark_folder.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,51 @@
}

#folderIcon {
background-image: url(chrome://theme/IDR_FOLDER_CLOSED);
<if expr="is_win">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_WIN_LIGHT);
</if>
<if expr="is_macosx">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_LIGHT);
</if>
<if expr="is_linux">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_LIN_LIGHT);
</if>
}

<if expr="not is_macosx">
#folderIcon {
height: 20px;
width: 20px;
}

#folderIcon[open] {
<if expr="is_win">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_OPEN_WIN_LIGHT);
</if>
<if expr="is_linux">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_OPEN_LIN_LIGHT);
</if>
}
</if>

/**
* Folder icons are OS-specific. On Mac, there is a separate folder icon
* for dark mode; on non-Mac, there is a separate folder icon for open states
* and the icon for that is slightly larger. This is mirroring the icons
* used in chrome://bookmarks.
*/
<if expr="is_macosx">
@media (prefers-color-scheme: dark) {
#folderIcon {
background-image: url(chrome://theme/IDR_FOLDER_CLOSED_WHITE);
}
}
<if expr="is_win">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_WIN_DARK);
</if>
<if expr="is_macosx">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_DARK);
</if>
<if expr="is_linux">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_CLOSED_LIN_DARK);
</if>
}

<if expr="not is_macosx">
#folderIcon {
Expand All @@ -109,9 +138,15 @@
}

#folderIcon[open] {
background-image: url(chrome://theme/IDR_FOLDER_OPEN);
<if expr="is_win">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_OPEN_WIN_DARK);
</if>
<if expr="is_linux">
background-image: url(chrome://theme/IDR_BRAVE_BOOKMARK_FOLDER_OPEN_LIN_DARK);
</if>
}
</if>
}

.title {
grid-area: title;
Expand Down

0 comments on commit 1560d3f

Please sign in to comment.