public TitledList(string title_str)
            : base()
        {
            genre_map = new Dictionary<string, Genre> ();
            title = new Label ();
            title.Xalign = 0;
            title.Ellipsize = Pango.EllipsizeMode.End;
            title.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (title_str));

            PackStart (title, false, false, 0);
            title.Show ();

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

            tile_view = new TileView (2);
            PackStart (tile_view, true, true, 0);
            tile_view.Show ();

            StyleSet += delegate {
                tile_view.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                tile_view.ModifyFg (StateType.Normal, Style.Base (StateType.Normal));
            };
        }
Beispiel #2
0
        public ArtworkPopup() : base(Gtk.WindowType.Popup)
        {
            VBox vbox = new VBox();
            Add(vbox);

            Decorated = false;
            BorderWidth = 6;

            SetPosition(WindowPosition.CenterAlways);

            image = new Gtk.Image();
            label = new Label(String.Empty);
            label.CanFocus = false;
            label.Wrap = true;

            label.ModifyBg(StateType.Normal, new Color(0, 0, 0));
            label.ModifyFg(StateType.Normal, new Color(160, 160, 160));
            ModifyBg(StateType.Normal, new Color(0, 0, 0));
            ModifyFg(StateType.Normal, new Color(160, 160, 160));

            vbox.PackStart(image, true, true, 0);
            vbox.PackStart(label, false, false, 0);

            vbox.Spacing = 6;
            vbox.ShowAll();
        }
Beispiel #3
0
        public TitledList (string title_str) : base (false, 3)
        {
            title = new Label ();
            title.Xalign = 0;
            title.Wrap = true;
            title.Layout.Wrap = Pango.WrapMode.Word;
            title.Ellipsize = Pango.EllipsizeMode.None;
            Title = title_str;

            PackStart (title, false, false, 0);
            title.Show ();

            StyleSet += delegate {
                title.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                title.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
            };
        }
Beispiel #4
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);
        }
Beispiel #5
0
		public GtkErrorDialog (Window parent, string title, string message, AlertButton[] buttons)
		{
			if (string.IsNullOrEmpty (title))
				throw new ArgumentException ();
			if (buttons == null)
				throw new ArgumentException ();
			
			Title = BrandingService.ApplicationName;
			TransientFor = parent;
			Modal = true;
			WindowPosition = Gtk.WindowPosition.CenterOnParent;
			DefaultWidth = 624;
			DefaultHeight = 142;
			
			this.VBox.BorderWidth = 2;
			
			var hbox = new HBox () {
				Spacing = 6,
				BorderWidth = 12,
			};
			
			var errorImage = new Image (Gtk.Stock.DialogError, IconSize.Dialog) {
				Yalign = 0F,
			};
			hbox.PackStart (errorImage, false, false, 0);
			this.VBox.Add (hbox);
			
			var vbox = new VBox () {
				Spacing = 6,
			};
			hbox.PackEnd (vbox, true, true, 0);
			
			var titleLabel = new Label () {
				Markup = "<b>" + GLib.Markup.EscapeText (title) + "</b>",
				Xalign = 0F,
			};
			vbox.PackStart (titleLabel, false, false, 0);
			
			if (!string.IsNullOrWhiteSpace (message)) {
				message = message.Trim ();
				var descriptionLabel = new Label (message) {
					Xalign = 0F,
					Selectable = true,
				};
				descriptionLabel.LineWrap = true;
				descriptionLabel.WidthRequest = 500;
				descriptionLabel.ModifyBg (StateType.Normal, new Gdk.Color (255,0,0));
				vbox.PackStart (descriptionLabel, false, false, 0);
			}
			
			expander = new Expander (GettextCatalog.GetString ("Details")) {
				CanFocus = true,
				Visible = false,
			};
			vbox.PackEnd (expander, true, true, 0);
			
			var sw = new ScrolledWindow () {
				HeightRequest = 180,
				ShadowType = ShadowType.Out,
			};
			expander.Add (sw);
			
			detailsTextView = new TextView () {
				CanFocus = true,
			};
			detailsTextView.KeyPressEvent += TextViewKeyPressed;
			sw.Add (detailsTextView);
			
			var aa = this.ActionArea;
			aa.Spacing = 10;
			aa.LayoutStyle = ButtonBoxStyle.End;
			aa.BorderWidth = 5;
			aa.Homogeneous = true;
			
			expander.Activated += delegate {
				this.AllowGrow = expander.Expanded;
				GLib.Timeout.Add (100, delegate {
					Resize (DefaultWidth, 1);
					return false;
				});
			};
			
			tagNoWrap = new TextTag ("nowrap");
			tagNoWrap.WrapMode = WrapMode.None;
			detailsTextView.Buffer.TagTable.Add (tagNoWrap);
			
			tagWrap = new TextTag ("wrap");
			tagWrap.WrapMode = WrapMode.Word;
			detailsTextView.Buffer.TagTable.Add (tagWrap);
			
			this.Buttons = buttons;
			for (int i = 0; i < Buttons.Length; i++) {
				Gtk.Button button;
				button = new Gtk.Button (Buttons[i].Label);
				button.ShowAll ();
				AddActionWidget (button, i);
			}
			
			Child.ShowAll ();
			Hide ();
		}
Beispiel #6
0
        private Widget CreateViewWidget()
        {
            HBox hbox = new HBox (false, 2);

            statusLabel = new Label ();
            statusLabel.ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            statusLabel.LineWrap = false;
            statusLabel.UseMarkup = true;
            statusLabel.UseUnderline = false;
            statusLabel.Show ();
            hbox.PackStart (statusLabel, true, true, 0);

            Image downImage = new Image (Stock.GoDown, IconSize.Menu);
            statusDownButton = new Button (downImage);
            statusDownButton.ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            statusDownButton.Relief = ReliefStyle.None;
            statusDownButton.Clicked += OnStatusDownButtonClicked;
            statusDownButton.Show ();
            hbox.PackStart (statusDownButton, false, false, 0);

            hbox.Show ();

            return hbox;
        }