Skip to content

Commit

Permalink
Fix #48 (customizable color for the first new note)
Browse files Browse the repository at this point in the history
  • Loading branch information
maoschanz committed Oct 5, 2020
1 parent 2a4c5e2 commit aaaf21c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PATH = GLib.build_pathv('/', [GLib.get_user_data_dir(), 'notes@maestroscha
// which is usually ~/.local/share/notes@maestroschan.fr

var NOTES_MANAGER;
let SETTINGS;
var SETTINGS;
var Z_POSITION;
var AUTO_FOCUS;

Expand Down
15 changes: 9 additions & 6 deletions [email protected]/noteBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ const _ = Gettext.gettext;
// ~/.local/share/notes@maestroschan.fr
const PATH = GLib.build_pathv('/', [GLib.get_user_data_dir(), '[email protected]']);

const MIN_HEIGHT = 50;
const MIN_WIDTH = 180;
const DEFAULT_COLOR = '200,0,0';
const MIN_HEIGHT = 75;
const MIN_WIDTH = 200;

//------------------------------------------------------------------------------

Expand All @@ -49,7 +48,11 @@ var NoteBox = class NoteBox {
if (color.split(',').length == 3) {
this.customColor = color;
} else {
this.customColor = DEFAULT_COLOR;
let c = Extension.SETTINGS.get_strv('first-note-rgb');
c[0] = c[0] * 255;
c[1] = c[1] * 255;
c[2] = c[2] * 255;
this.customColor = c.toString();
}
this._buildNote();
}
Expand All @@ -58,8 +61,8 @@ var NoteBox = class NoteBox {
this.actor = new St.BoxLayout({
reactive: true,
vertical: true,
min_height: 75,
min_width: 245,
min_height: MIN_HEIGHT,
min_width: MIN_WIDTH,
style_class: 'noteBoxStyle',
track_hover: true,
});
Expand Down

0 comments on commit aaaf21c

Please sign in to comment.