Example #1
0
    public static void ChronopicColors(Gtk.Viewport v, Gtk.Label l1, Gtk.Label l2, bool connected)
    {
        //if(! v.Style.Background(StateType.Normal).Equal(BLUE))
        if (!v.Style.Background(StateType.Normal).Equal(v.Style.Background(StateType.Selected)))
        {
            chronopicViewportDefaultBg = v.Style.Background(StateType.Normal);
        }
        if (!l1.Style.Foreground(StateType.Normal).Equal(WHITE))
        {
            chronopicLabelsDefaultFg = l1.Style.Foreground(StateType.Normal);
        }

        if (connected)
        {
            v.ModifyBg(StateType.Normal, chronopicViewportDefaultBg);
            l1.ModifyFg(StateType.Normal, chronopicLabelsDefaultFg);
            l2.ModifyFg(StateType.Normal, chronopicLabelsDefaultFg);
        }
        else
        {
            //v.ModifyBg(StateType.Normal, BLUE);
            v.ModifyBg(StateType.Normal, v.Style.Background(StateType.Selected));
            l1.ModifyFg(StateType.Normal, WHITE);
            l2.ModifyFg(StateType.Normal, WHITE);
        }
    }
        // "Coming Soon: Profile, Friends, Events etc")
        public LastfmSourceContents () : base ()
        {
            HscrollbarPolicy = PolicyType.Never;
            VscrollbarPolicy = PolicyType.Automatic;

            viewport = new Viewport ();
            viewport.ShadowType = ShadowType.None;

            main_box = new VBox ();
            main_box.Spacing = 6;
            main_box.BorderWidth = 5;
            main_box.ReallocateRedraws = true;

            // Clamp the width, preventing horizontal scrolling
            SizeAllocated += delegate (object o, SizeAllocatedArgs args) {
                // TODO '- 10' worked for Nereid, but not for Cubano; properly calculate the right width we should request
                main_box.WidthRequest = args.Allocation.Width - 30;
            };

            viewport.Add (main_box);

            StyleSet += delegate {
                viewport.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                viewport.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
            };

            AddWithFrame (viewport);
            ShowAll ();
        }
Example #3
0
    public static void DeviceColors(Gtk.Viewport v, bool connected)
    {
        if (!v.Style.Background(StateType.Normal).Equal(v.Style.Background(StateType.Selected)))
        {
            chronopicViewportDefaultBg = v.Style.Background(StateType.Normal);
        }

        if (connected)
        {
            //v.ModifyBg(StateType.Normal, chronopicViewportDefaultBg);
            v.ModifyBg(StateType.Normal, WHITE);
        }
        else
        {
            //v.ModifyBg(StateType.Normal, BLUE);
            v.ModifyBg(StateType.Normal, v.Style.Background(StateType.Selected));
        }
    }
Example #4
0
    public static void ViewportColorDefault(Gtk.Viewport v)
    {
        //v.ModifyBg(StateType.Normal); //resets to the default color

        //create a new viewport and get the color
        Gtk.Viewport vTemp = new Gtk.Viewport();
        Gdk.Color    colorViewportDefault = vTemp.Style.Background(StateType.Normal);

        //assign the color to our requested viewport
        v.ModifyBg(StateType.Normal, colorViewportDefault);         //resets to the default color
    }
        public RadioSourceContents()
        {
            HscrollbarPolicy = PolicyType.Never;
            VscrollbarPolicy = PolicyType.Automatic;

            viewport = new Viewport ();
            viewport.ShadowType = ShadowType.None;

            main_box = new VBox ();
            main_box.Spacing = 6;
            main_box.BorderWidth = 5;
            main_box.ReallocateRedraws = true;

            // Clamp the width, preventing horizontal scrolling
            SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                main_box.WidthRequest = args.Allocation.Width - 10;
            };

            viewport.Add (main_box);

            StyleSet += delegate {
                viewport.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                viewport.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
            };

            logo_pix = new Gdk.Pixbuf (System.Reflection.Assembly.GetExecutingAssembly ()
                                       .GetManifestResourceStream ("logo_color_large.gif"));
            logo = new Image (logo_pix);

            // auto-scale logo
            SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                int width = args.Allocation.Width - 50;
                logo.Pixbuf = logo_pix.ScaleSimple (width, (int)((float)width / 6.3f), Gdk.InterpType.Bilinear);
            };

            main_box.PackStart (logo, false, false, 0);

            genres = new TitledList ("Genres");
            main_box.PackStart (genres, false, false, 0);

            AddWithFrame (viewport);
            ShowAll ();
        }
Example #6
0
        /// <summary>
        /// Update Gtk objects properties
        /// </summary>
        private void UpdateGraphicObjects()
        {
            // Set dialog icon
            AboutDialog.Icon = Gdk.Pixbuf.LoadFromResource("comex_256.png");

            // Set description area back color
            vpTitle.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));

            // Create and add tab for About info
            AddLabelTab(ref lblAbout, GlobalObj.LMan.GetString("about"));

            // Create and add tab for Thanks info
            AddLabelTab(ref lblThanks, GlobalObj.LMan.GetString("thanks"));

            imgLogo.Pixbuf = Gdk.Pixbuf.LoadFromResource("comex_32.png");
            vpLogo.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));

            lblTitle.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));

            //Gdk.Geometry geo = new Gdk.Geometry();
            //geo.MinHeight = 380;
            //geo.MinWidth = 500;
            //AboutDialog.SetGeometryHints(tabInfo, geo, Gdk.WindowHints.MinSize);
        }
 /// <summary>
 /// Add tab to notebook object
 /// </summary>
 private void AddLabelTab(ref Gtk.Label lblObj, string title)
 {
     // Create and add tab for Thanks info
     ScrolledWindow sw = new ScrolledWindow();
     Viewport vp = new Viewport();
     sw.AddWithViewport(vp);
     lblObj = new Label();
     lblObj.SetPadding(4,4);
     lblObj.SetAlignment((float)0, (float)0);
     vp.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
     vp.Add(lblObj);
     tabInfo.AppendPage(sw, new Gtk.Label(title));
 }
        private void UpdateGraphicObjects()
        {
            // Set dialog icon
            AboutDialog.Icon = Gdk.Pixbuf.LoadFromResource("themonospot.png");
            vpTitle.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            AboutDialog.Title = GlobalData.GetLanguageKeyValue("ABOUTWINTITLE");

            ScrolledWindow sw = new ScrolledWindow();
            Viewport vp = new Viewport();
            sw.Add(vp);
            Label lblContent = new Label();
            lblContent.SetPadding(4,4);
            lblContent.SetAlignment((float)0, (float)0);
            vp.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            lblContent.Markup =
                "<b>Themonospot Gtk</b>\r\n" +
                "  " + GlobalData.GuiDescription + "\r\n\r\n" +
                "Copyright " + GlobalData.GuiCopyright + "\r\n\r\n" +
                "<b>Website</b>\r\n" +
                "  www.integrazioneweb.com/themonospot\r\n\r\n" +
                "<b>Developers</b>\r\n" +
                "  Armando Basile <i>([email protected])</i>\r\n" +
                "  Giuseppe Coviello <i>([email protected])</i>\r\n\r\n" +
                "<b>Special thanks to</b>\r\n" +
                "  Moitah <i>([email protected])</i>\r\n" +
                "  Insomniac <i>([email protected])</i>\r\n" +
                "  Rigel.va\r\n" +
                "  Mubumba <i>([email protected])</i>\r\n\r\n" +
                "<b>Bugs report</b>\r\n" +
                "  https://github.com/armando-basile/themonospot/issues\r\n";

            vp.Add(lblContent);

            tabInfo.AppendPage(sw, new Label(GlobalData.GetLanguageKeyValue("ABOUTTABINFO")));

            string components = "<b>base component: </b>" + GlobalData.BaseRelease + "\r\n";
            for (int j=0; j<GlobalData.BasePlugins.Count; j++)
            {
                components += "<b>" + GlobalData.BasePlugins[j].FileName + ": </b>" +
                    GlobalData.BasePlugins[j].Release + "\r\n";
            }

            sw = new ScrolledWindow();
            vp = new Viewport();
            sw.Add(vp);
            lblContent = new Label();
            lblContent.SetPadding(4,4);
            lblContent.SetAlignment((float)0, (float)0);
            lblContent.Markup = components;
            vp.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));

            vp.Add(lblContent);

            tabInfo.AppendPage(sw, new Label(GlobalData.GetLanguageKeyValue("ABOUTTABCOMPONENTS")));

            tabInfo.ShowAll();

            imgLogo.Pixbuf = Gdk.Pixbuf.LoadFromResource("themonospot.png");
            vpLogo.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));

            lblTitle.Markup = "<b>Themonospot [Gtk]</b>\r\n" +
                GlobalData.GuiRelease;
            lblTitle.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));

            Gdk.Geometry geo = new Gdk.Geometry();
            geo.MinHeight = 380;
            geo.MinWidth = 500;
            AboutDialog.SetGeometryHints(tabInfo, geo, Gdk.WindowHints.MinSize);

            // wait for gui processes
            while (Gtk.Application.EventsPending ())
                Gtk.Application.RunIteration ();
        }
        public SongKickSourceContents()
        {
            //HscrollbarPolicy = PolicyType.Never;
            //VscrollbarPolicy = PolicyType.Automatic;

            viewport = new Viewport ();
            viewport.ShadowType = ShadowType.None;

            main_box = new HBox () { Spacing = 6, BorderWidth = 5, ReallocateRedraws = true };

            search_by_artist_contents_box = new SearchEventsBox (new EventsByArtistSearch());
            search_by_location_contents_box = new SearchEventsBox (new EventsByLocationSearch());
            search_location_contents_box = new SearchLocationBox (new LocationSearch());
            search_artists_contents_box = new SearchArtistsBox (new ArtistSearch());

            recommendations_contents_box = new RecommendedArtistsBox();
            recommendations_contents_box.RowActivated += OnRecommendedArtistRowActivate;

            search_location_contents_box.View.RowActivated += SearchLocationRowActivate;
            search_artists_contents_box.View.RowActivated += SearchArtistRowActivate;

            menu_box = BuildTiles();

            main_box.PackStart (menu_box, false, false, 0);
            contents_box = new HBox ();
            main_box.PackStart (contents_box, true, true, 0);

            // set default contents box
            SetView (this.presonal_recommendation_view);

            // Clamp the width, preventing horizontal scrolling
            /*
            SizeAllocated += delegate (object o, SizeAllocatedArgs args) {
                // TODO '- 10' worked for Nereid, but not for Cubano; properly calculate the right width we should request
                main_box.WidthRequest = args.Allocation.Width - 30;
            };
            */

            viewport.Add (main_box);
            #pragma warning disable 612
            StyleSet += delegate {
                viewport.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                viewport.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
            };
            #pragma warning restore 612
            recommendations_contents_box.LoadAndPresentRecommendations ();

            AddWithFrame (viewport);
            ShowAll ();
        }
Example #10
0
 public static void ViewportColor(Gtk.Viewport v, Gdk.Color color)
 {
     v.ModifyBg(StateType.Normal, color);
 }