[longomatch] Use new icons to activate/deactivate links mode
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Use new icons to activate/deactivate links mode
- Date: Fri, 17 Apr 2015 16:25:06 +0000 (UTC)
commit 8d34de0a450e8e4d189911158bda9b623828ea9e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Apr 14 12:05:36 2015 +0200
Use new icons to activate/deactivate links mode
LongoMatch.GUI/Gui/Component/DashboardWidget.cs | 76 +++++++++++---------
data/icons/Makefile.am | 2 +
.../scalable/actions/longomatch-link-active.svg | 12 +++
.../scalable/actions/longomatch-link-disabled.svg | 12 +++
4 files changed, 68 insertions(+), 34 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
index 9d07845..bd8669d 100644
--- a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
@@ -167,30 +167,7 @@ namespace LongoMatch.Gui.Component
public DashboardMode Mode {
set {
- ignoreChanges = true;
- mode = value;
- tagger.Mode = value;
- // Properties only visible in edit mode
- rightbox.Visible = mode == DashboardMode.Edit;
- // Add buttons for cards/tags/etc.. can be handled remotely.
- hbuttonbox2.Visible = mode == DashboardMode.Edit && internalButtons;
- editbutton.Active = value == DashboardMode.Edit;
- if (value == DashboardMode.Edit) {
- editimage.Pixbuf = Helpers.Misc.LoadIcon
("longomatch-dash-edit_active", 22);
- } else {
- editimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-dash-edit", 22);
- }
- LongoMatch.Gui.Helpers.Misc.SetFocus (this, value == DashboardMode.Edit);
- if (project != null) {
- if (value == DashboardMode.Edit) {
- Edited = false;
- } else {
- if (Edited)
- Config.EventsBroker.EmitDashboardEdited ();
- }
-
- }
- ignoreChanges = false;
+ UpdateMode (value);
}
get {
return mode;
@@ -244,6 +221,35 @@ namespace LongoMatch.Gui.Component
Refresh (button);
}
+ void UpdateMode (DashboardMode mode)
+ {
+ ignoreChanges = true;
+ tagger.Mode = this.mode = mode;
+ // Add buttons for cards/tags/etc.. can be handled remotely.
+ hbuttonbox2.Visible = mode == DashboardMode.Edit && internalButtons;
+ editbutton.Active = rightbox.Visible = linksbutton.Visible = mode ==
DashboardMode.Edit;
+
+ if (mode == DashboardMode.Edit) {
+ editimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-dash-edit_active", 22);
+ tagger.ShowLinks = linksbutton.Active;
+ } else {
+ editimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-dash-edit", 22);
+ tagger.ShowLinks = false;
+ }
+
+ LongoMatch.Gui.Helpers.Misc.SetFocus (this, mode == DashboardMode.Edit);
+ if (project != null) {
+ if (mode == DashboardMode.Edit) {
+ Edited = false;
+ } else {
+ if (Edited)
+ Config.EventsBroker.EmitDashboardEdited ();
+ }
+
+ }
+ ignoreChanges = false;
+ }
+
void RemoveButton (DashboardButton button)
{
string msg = Catalog.GetString ("Do you want to delete: ") +
@@ -275,16 +281,14 @@ namespace LongoMatch.Gui.Component
editimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-edit_active", 22));
editbutton = new ToggleToolButton ();
editbutton.IconWidget = editimage;
- editbutton.Active = true;
editbutton.Toggled += HandleEditToggled;
editbutton.TooltipText = Catalog.GetString ("Edit dashboard");
toolbar.Add (editbutton);
toolbar.Add (new SeparatorToolItem ());
- editimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-edit_active", 22));
+ linksimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-link-disabled", 22));
linksbutton = new ToggleToolButton ();
- linksbutton.IconWidget = editimage;
- linksbutton.Active = false;
+ linksbutton.IconWidget = linksimage;
linksbutton.Toggled += HandleLinksToggled;
linksbutton.TooltipText = Catalog.GetString ("Edit actions links");
toolbar.Add (linksbutton);
@@ -315,6 +319,9 @@ namespace LongoMatch.Gui.Component
toolbar.Add (d11button);
toolbar.ShowAll ();
hbox2.PackEnd (toolbar, false, false, 0);
+
+ editbutton.Active = true;
+ linksbutton.Active = false;
}
void UpdateBackground (Image background, int index)
@@ -346,18 +353,19 @@ namespace LongoMatch.Gui.Component
return;
}
if (editbutton.Active) {
- Mode = DashboardMode.Edit;
- linksbutton.Visible = true;
- tagger.ShowLinks = linksbutton.Active;
+ UpdateMode (DashboardMode.Edit);
} else {
- Mode = DashboardMode.Code;
- tagger.ShowLinks = false;
- linksbutton.Visible = false;
+ UpdateMode (DashboardMode.Code);
}
}
void HandleLinksToggled (object sender, EventArgs e)
{
+ if (linksbutton.Active) {
+ linksimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-link-active", 22);
+ } else {
+ linksimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-link-disabled", 22);
+ }
if (ignoreChanges) {
return;
}
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index 84b498d..11817f4 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -44,6 +44,8 @@ nobase_dist_icons_DATA = Makefile.am \
hicolor/scalable/actions/longomatch-field-full.svg \
hicolor/scalable/actions/longomatch-field-goal.svg \
hicolor/scalable/actions/longomatch-field-half.svg \
+ hicolor/scalable/actions/longomatch-link-active.svg \
+ hicolor/scalable/actions/longomatch-link-disabled.svg \
hicolor/scalable/actions/longomatch-live.svg \
hicolor/scalable/actions/longomatch-mark.svg \
hicolor/scalable/actions/longomatch-pause-clock.svg \
diff --git a/data/icons/hicolor/scalable/actions/longomatch-link-active.svg
b/data/icons/hicolor/scalable/actions/longomatch-link-active.svg
new file mode 100644
index 0000000..cfe509d
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-link-active.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px"
+ width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36"
xml:space="preserve">
+<path fill="#50B149" d="M29.447,14.632l-0.248-0.642c-1.547-4.009-5.16-6.711-9.371-7.095l-0.002,2.869
+
c4.105,0.496,7.297,4.001,7.297,8.236c0,2.217-0.863,4.3-2.43,5.866c-1.33,1.329-3.029,2.152-4.865,2.37l-0.002,2.868
+
c2.588-0.236,4.988-1.359,6.848-3.219c1.107-1.106,1.955-2.402,2.518-3.854l0.246-0.638H35v-6.764H29.447z"/>
+<path fill="#6A6A6A"
d="M16.784,11.705V6.893c-2.601,0.229-5.017,1.354-6.885,3.222c-1.106,1.106-1.953,2.403-2.516,3.854
+
l-0.247,0.638H1.001L1,21.37l6.128,0.001l0.247,0.641c1.526,3.958,5.23,6.714,9.409,7.096v-4.81h1c1.683,0,3.263-0.655,4.452-1.845
+ s1.844-2.77,1.844-4.452c0-3.471-2.824-6.295-6.296-6.296H16.784z"/>
+</svg>
diff --git a/data/icons/hicolor/scalable/actions/longomatch-link-disabled.svg
b/data/icons/hicolor/scalable/actions/longomatch-link-disabled.svg
new file mode 100644
index 0000000..b4cf078
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-link-disabled.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px"
+ width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36"
xml:space="preserve">
+<path fill="#333333" d="M29.447,14.632l-0.248-0.642c-1.547-4.009-5.16-6.711-9.371-7.095l-0.002,2.869
+
c4.105,0.496,7.297,4.001,7.297,8.236c0,2.217-0.863,4.3-2.43,5.866c-1.33,1.329-3.029,2.152-4.865,2.37l-0.002,2.868
+
c2.588-0.236,4.988-1.359,6.848-3.219c1.107-1.106,1.955-2.402,2.518-3.854l0.246-0.638H35v-6.764H29.447z"/>
+<path fill="#252627"
d="M16.784,11.705V6.893c-2.601,0.229-5.017,1.354-6.885,3.222c-1.106,1.106-1.953,2.403-2.516,3.854
+
l-0.247,0.638H1.001L1,21.37l6.128,0.001l0.247,0.641c1.526,3.958,5.23,6.714,9.409,7.096v-4.81h1c1.683,0,3.263-0.655,4.452-1.845
+ s1.844-2.77,1.844-4.452c0-3.471-2.824-6.295-6.296-6.296H16.784z"/>
+</svg>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]