Skip to content

Commit

Permalink
header toolbar style and custom icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Alecaddd committed Jan 5, 2018
1 parent e3fd7ab commit 60362ac
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
27 changes: 27 additions & 0 deletions data/assets.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,31 @@
<gresource prefix="/com/github/alecaddd/akira">
<file alias="stylesheet.css" compressed="true">stylesheet.css</file>
</gresource>
<gresource prefix="/com/github/alecaddd/akira/tools">
<file alias="artboard.svg" compressed="true" preprocess="xml-stripblanks">assets/tools/artboard.svg</file>
<file alias="bool-difference.svg" compressed="true" preprocess="xml-stripblanks">assets/tools/bool-difference.svg</file>
<file alias="bool-interesect.svg" compressed="true" preprocess="xml-stripblanks">assets/tools/bool-intersect.svg</file>
<file alias="bool-subtract.svg" compressed="false" preprocess="">assets/tools/bool-subtract.svg</file>
<file alias="bool-union.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/bool-union.svg</file>
<file alias="eye.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/eye.svg</file>
<file alias="gear.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/gear.svg</file>
<file alias="grid.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/grid.svg</file>
<file alias="group.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/group.svg</file>
<file alias="image.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/image.svg</file>
<file alias="knife.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/knife.svg</file>
<file alias="move-above.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/move-above.svg</file>
<file alias="move-below.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/move-below.svg</file>
<file alias="pen.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pen.svg</file>
<file alias="pencil-alt.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pencil-alt.svg</file>
<file alias="pencil-alt2.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pencil-alt2.svg</file>
<file alias="pencil.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pencil.svg</file>
<file alias="pixels.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pixels.svg</file>
<file alias="plus.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/plus.svg</file>
<file alias="pointer-alt.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pointer-alt.svg</file>
<file alias="pointer.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/pointer.svg</file>
<file alias="shapes.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/shapes.svg</file>
<file alias="text.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/text.svg</file>
<file alias="ui-panels.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/ui-panels.svg</file>
<file alias="ungroup.svg" compressed="false" preprocess="xml-stripblanks">assets/tools/ungroup.svg</file>
</gresource>
</gresources>
32 changes: 32 additions & 0 deletions data/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,36 @@
background-color: @sideLBg;
color: @sideLText;
border-left: 1px solid @sideLBorder;
}

.toolbar {
background: #f2f2f2;
border-bottom-color: #b6b4b6;
border-top-color: #ffffff;
outline-color: transparent;
border-bottom-width: 1px;
box-shadow: none;
outline: none;
}

.toolbar GtkImage {
padding-top: 3px;
padding-bottom: 3px;
padding-right: 3px;
padding-left: 3px;
}

.toolbar GtkWidget {
border-color: rgba(0,0,0,0.1);
border-top: none;
border-left: none;
border-bottom: none;
}

.toolbar GtkWidget:last-child {
border-right: none;
}

.toolbar GtkWidget:checked {
background-color: rgba(0,0,0,0.2);
}
2 changes: 1 addition & 1 deletion src/Partials/HeaderBarButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Akira.Partials.HeaderBarButton : Gtk.Button {
if (icon_name.contains ("/")) {
image = new Gtk.Image.from_resource (icon_name);
} else {
image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.BUTTON);
image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.LARGE_TOOLBAR);
}

image.margin = 0;
Expand Down
7 changes: 4 additions & 3 deletions src/Widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ public class Akira.Widgets.HeaderBar : Gtk.Box {
save_file.sensitive = false;

var icon_mode = new Granite.Widgets.ModeButton ();
icon_mode.append_icon ("view-grid-symbolic", Gtk.IconSize.BUTTON);
icon_mode.append_icon ("view-list-symbolic", Gtk.IconSize.BUTTON);
icon_mode.append_icon ("view-column-symbolic", Gtk.IconSize.BUTTON);
icon_mode.get_style_context ().add_class ("toolbar");
icon_mode.append_pixbuf (new Gdk.Pixbuf.from_resource ("/com/github/alecaddd/akira/tools/pointer.svg"));
icon_mode.append_pixbuf (new Gdk.Pixbuf.from_resource ("/com/github/alecaddd/akira/tools/artboard.svg"));
icon_mode.append_pixbuf (new Gdk.Pixbuf.from_resource ("/com/github/alecaddd/akira/tools/shapes.svg"));

toolbar.add (icon_mode);

Expand Down

0 comments on commit 60362ac

Please sign in to comment.