Skip to content

Commit

Permalink
feat: change the way to load svg files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroreisvieira committed Dec 28, 2018
1 parent b3589ca commit ba5c118
Show file tree
Hide file tree
Showing 19 changed files with 147 additions and 144 deletions.
270 changes: 135 additions & 135 deletions Mariana-Theme-Light.sublime-theme
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@
],
"layer0.opacity": 1
},
{
"class": "fold_button_control",
"layer0.texture": "mariana-theme/assets/light/fold_right.png",
"layer0.opacity": 1,
"layer0.inner_margin": 0,
"layer1.texture": "mariana-theme/assets/light/fold_right_hover.png",
"layer1.opacity": 0,
"layer1.inner_margin": 0,
"content_margin": [
9,
7,
8,
6
]
},
{
"class": "fold_button_control",
"attributes": [
"hover"
],
"layer0.opacity": 0,
"layer1.opacity": 1
},
{
"class": "fold_button_control",
"attributes": [
"expanded"
],
"layer0.texture": "mariana-theme/assets/light/fold_down.png",
"layer1.texture": "mariana-theme/assets/light/fold_down_hover.png"
},
{
"class": "button_control",
"layer0.tint": [
Expand Down Expand Up @@ -269,7 +300,7 @@
},
{
"class": "icon_in_selection",
"layer0.texture": "mariana-theme/assets/light/in_selection.png",
"layer0.texture": "mariana-theme/assets/light/icon_in_selection.png",
"layer0.opacity": {
"target": 0.5,
"speed": 5,
Expand Down Expand Up @@ -305,7 +336,7 @@
},
{
"class": "icon_highlight",
"layer0.texture": "mariana-theme/assets/light/highlight_matches.png",
"layer0.texture": "mariana-theme/assets/light/icon_highlight_matches.png",
"layer0.opacity": {
"target": 0.5,
"speed": 5,
Expand Down Expand Up @@ -447,37 +478,6 @@
],
"layer0.opacity": 1
},
{
"class": "fold_button_control",
"layer0.texture": "mariana-theme/assets/light/fold_right.png",
"layer0.opacity": 1,
"layer0.inner_margin": 0,
"layer1.texture": "mariana-theme/assets/light/fold_right_hover.png",
"layer1.opacity": 0,
"layer1.inner_margin": 0,
"content_margin": [
9,
7,
8,
6
]
},
{
"class": "fold_button_control",
"attributes": [
"hover"
],
"layer0.opacity": 0,
"layer1.opacity": 1
},
{
"class": "fold_button_control",
"attributes": [
"expanded"
],
"layer0.texture": "mariana-theme/assets/light/fold_down.png",
"layer1.texture": "mariana-theme/assets/light/fold_down_hover.png"
},
{
"class": "dialog",
"layer0.tint": [
Expand Down Expand Up @@ -611,6 +611,32 @@
9
]
},
{
"class": "label_control",
"fg": [
64,
64,
64
],
"font.size": 12
},
{
"class": "title_label_control",
"fg": [
64,
64,
64
],
"font.size": 24
},
{
"class": "label_control",
"parents": [
{
"class": "button_control"
}
]
},
{
"class": "text_line_control",
"layer0.tint": [
Expand Down Expand Up @@ -681,32 +707,6 @@
],
"layer1.opacity": 1
},
{
"class": "label_control",
"fg": [
64,
64,
64
],
"font.size": 12
},
{
"class": "title_label_control",
"fg": [
64,
64,
64
],
"font.size": 24
},
{
"class": "label_control",
"parents": [
{
"class": "button_control"
}
]
},
{
"class": "close_button",
"layer0.texture": "mariana-theme/assets/light/close_icon.png",
Expand Down Expand Up @@ -1198,70 +1198,30 @@
"font.bold": true
},
{
"class": "status_bar",
"layer0.tint": [
171,
177,
186
],
"layer0.opacity": 1,
"content_margin": [
10,
2,
0,
2
]
},
{
"class": "panel_button_control",
"layer0.texture": "mariana-theme/assets/light/overflow_menu.png",
"layer0.opacity": 1,
"content_margin": [
8,
8
]
},
{
"class": "panel_button_control",
"attributes": [
"hover"
"class": "title_bar",
"bg": [
115,
128,
140
],
"layer0.texture": "mariana-theme/assets/light/overflow_menu_hover.png"
},
{
"class": "status_container",
"content_margin": [
8,
0,
0,
0
"fg": [
235,
237,
239
]
},
{
"class": "status_button",
"content_margin": [
10,
0,
10,
0
"class": "title_bar",
"settings": [
"mariana_theme_titlebar"
],
"min_size": [
80,
0
]
},
{
"class": "label_control",
"parents": [
{
"class": "status_bar"
}
"bg": [
"background",
0.96
],
"font.size": 11,
"color": [
30,
40,
44
"fg": [
"foreground",
1
]
},
{
Expand Down Expand Up @@ -1621,30 +1581,70 @@
}
},
{
"class": "title_bar",
"bg": [
115,
128,
140
"class": "status_bar",
"layer0.tint": [
171,
177,
186
],
"fg": [
235,
237,
239
"layer0.opacity": 1,
"content_margin": [
10,
2,
0,
2
]
},
{
"class": "title_bar",
"settings": [
"mariana_theme_titlebar"
"class": "panel_button_control",
"layer0.texture": "mariana-theme/assets/light/overflow_menu.png",
"layer0.opacity": 1,
"content_margin": [
8,
8
]
},
{
"class": "panel_button_control",
"attributes": [
"hover"
],
"bg": [
"background",
0.96
"layer0.texture": "mariana-theme/assets/light/overflow_menu_hover.png"
},
{
"class": "status_container",
"content_margin": [
8,
0,
0,
0
]
},
{
"class": "status_button",
"content_margin": [
10,
0,
10,
0
],
"fg": [
"foreground",
1
"min_size": [
80,
0
]
},
{
"class": "label_control",
"parents": [
{
"class": "status_bar"
}
],
"font.size": 11,
"color": [
30,
40,
44
]
},
{
Expand Down
Binary file modified assets/light/icon_case_sensitive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/light/icon_case_sensitive@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/light/icon_case_sensitive@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/light/icon_in_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/light/icon_in_selection@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/light/icon_in_selection@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/light/in_selection.png
Binary file not shown.
Binary file removed assets/light/in_selection@2x.png
Binary file not shown.
Binary file removed assets/light/in_selection@3x.png
Binary file not shown.
6 changes: 3 additions & 3 deletions gulp-tasks/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
import path from "path";
import fs from "fs";
import svg2png from "svg2png";
import allIcons from "./../src/icons/icons.json";
import options from "./../src/icons/options.json";

const debug = true;

function __icons(variation) {
let iconPath;
allIcons.forEach(icon => {
fs.readdirSync("./src/icons/svg").forEach(icon => {
if (debug) console.log(`👁 - Reading ${icon} icon.`);
iconPath = path.join(__dirname, `/../src/icons/svg/${icon}.svg`);
iconPath = path.join(__dirname, `/../src/icons/svg/${icon}`);
fs.readFile(iconPath, (err, data) => {
if (err) throw err;
icon = icon.split(".").slice(0, -1).join(".");
options.settings.forEach(setting => {
svg2png(data, { width: setting.size, height: setting.size })
.then(buffer => {
Expand Down
4 changes: 0 additions & 4 deletions src/icons/icons.json

This file was deleted.

4 changes: 4 additions & 0 deletions src/icons/svg/icon_case_sensitive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
3 changes: 3 additions & 0 deletions src/icons/svg/icon_in_selection.svg
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 src/themes/light/buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
},
{
"class": "icon_in_selection",
"layer0.texture": "mariana-theme/assets/light/in_selection.png",
"layer0.texture": "mariana-theme/assets/light/icon_in_selection.png",
"layer0.opacity": { "target": 0.5, "speed": 5.0, "interpolation": "smoothstep" },
"content_margin": [12, 12]
},
Expand All @@ -121,7 +121,7 @@
},
{
"class": "icon_highlight",
"layer0.texture": "mariana-theme/assets/light/highlight_matches.png",
"layer0.texture": "mariana-theme/assets/light/icon_highlight_matches.png",
"layer0.opacity": { "target": 0.5, "speed": 5.0, "interpolation": "smoothstep" },
"content_margin": [12, 12]
},
Expand Down

0 comments on commit ba5c118

Please sign in to comment.