public Gtk.Label AddNewLine() { Gtk.Label label = WidgetFu.NewLabel(""); label.Show(); Attach(label, 1, 2, current_row, ++current_row, fill, fill, 0, 0); return(label); }
protected override void LoadIcon(Gtk.Image image, int size) { base.LoadIcon(image, size); string parent_mime_type = XdgMime.GetMimeTypeFromFileName(Hit.EscapedParentUri); if (parent_mime_type == null) { return; } Gdk.Pixbuf emblem = WidgetFu.LoadMimeIcon(parent_mime_type, 24); if (emblem == null) { return; } Gdk.Pixbuf icon = image.Pixbuf.Copy(); emblem.Composite(icon, 0, // dest_x icon.Height - emblem.Height, // dest_y emblem.Width, // dest_width emblem.Height, // dest_height 0, // offset_x icon.Height - emblem.Height, // offset_y 1, 1, // scale Gdk.InterpType.Bilinear, 255); image.Pixbuf.Dispose(); image.Pixbuf = icon; }
private void About(object obj, EventArgs args) { Gdk.Pixbuf logo = WidgetFu.LoadThemeIcon("system-search", 48); string[] people = new string[] { "Anna Dirks <*****@*****.**>", "Dan Winship <*****@*****.**>", "D Bera <*****@*****.**>", "Fredrik Hedberg <*****@*****.**>", "Joe Shaw <*****@*****.**>", "Jakub Steiner <*****@*****.**>", "Lukas Lipka <*****@*****.**>", }; string translators = Catalog.GetString("translator-credits"); if (translators == "translator-credits") // not translated { translators = null; } #pragma warning disable 612 // don't warn that Gnome.About is deprecated Gnome.About about = new Gnome.About("Beagle Search", Beagle.Util.ExternalStringsHack.Version, VersionFu.DefaultCopyright, null, people, null, null, logo); about.Run(); about.Dispose(); #pragma warning restore 612 }
protected override void LoadIcon(Gtk.Image image, int size) { Hashtable icons = (Hashtable)all_icons[size]; if (icons == null) { all_icons[size] = icons = IconsForSize(size); } string protocol = Hit.GetFirstProperty("fixme:protocol"); if (protocol == null) { protocol = String.Empty; } if (icons [protocol] != null) { image.Pixbuf = (Gdk.Pixbuf)icons [protocol]; } else { image.Pixbuf = WidgetFu.LoadThemeIcon("im", size); } }
protected override void LoadIcon(Gtk.Image image, int size) { base.LoadIcon(image, size); // Draw the F-Spot overlay if (size > 32 && Hit ["fspot:IsIndexed"] == "true") { Gdk.Pixbuf emblem = WidgetFu.LoadThemeIcon("f-spot", 24); Gdk.Pixbuf icon = image.Pixbuf.Copy(); if (icon == null || emblem == null) { return; } // FIXME: Ideally we'd composite into a fresh new pixbuf of // the correct size in this case, but really, who's going to // have images shorter or narrower than 16 pixels in f-spot?? if (icon.Height < emblem.Height || icon.Width < emblem.Width) { icon.Dispose(); emblem.Dispose(); return; } emblem.Composite(icon, 0, icon.Height - emblem.Height, emblem.Width, emblem.Height, 0, icon.Height - emblem.Height, 1, 1, Gdk.InterpType.Bilinear, 255); image.Pixbuf.Dispose(); image.Pixbuf = icon; } }
protected override void OnDragBegin (Gdk.DragContext context) { if (!icon.Visible) return; WidgetFu.SetDragImage (context, icon); }
protected override void LoadIcon(Gtk.Image image, int size) { Gdk.Pixbuf pixbuf = null; string path = Hit ["fixme:cachedimg"]; if (path != null && File.Exists(path)) { try { pixbuf = new Gdk.Pixbuf(path); } catch (GLib.GException) { // Catch in case of an invalid pixbuf. } } if (pixbuf != null && (pixbuf.Width > size || pixbuf.Height > size)) { pixbuf = pixbuf.ScaleSimple(size, size, Gdk.InterpType.Bilinear); } if (pixbuf == null) { pixbuf = WidgetFu.LoadThemeIcon("gnome-fs-bookmark", size); // FIXME: RSS icon? } image.Pixbuf = pixbuf; }
private Gtk.Label AddGrayLabel(string text, uint row, uint column) { Gtk.Label label = WidgetFu.NewGrayLabel(text); label.SetAlignment(1.0f, 0.0f); label.Show(); Attach(label, column, column + 1, row, row + 1, fill, fill, 0, 0); maximized = false; return(label); }
protected virtual void LoadIcon (Gtk.Image image, int size) { // This is a hack to prevent large mime icons when we // dont have a thumbnail. if (size > 48) size = 48; image.Pixbuf = WidgetFu.LoadMimeIcon (hit.MimeType, size); }
private Gtk.Label AddBoldLabel(string text, uint row, uint column) { Gtk.Label label = WidgetFu.NewBoldLabel(text); label.SetAlignment(0.0f, 0.0f); WidgetFu.EllipsizeLabel(label); label.Show(); Attach(label, column, column + 1, row, row + 1, expand, fill, 0, 0); maximized = false; return(label); }
protected override void LoadIcon(Gtk.Image image, int size) { Gdk.Pixbuf icon = null; string path = Hit ["fixme:Icon"]; if (path != null && path != "") { try { if (path.StartsWith("/")) { icon = new Gdk.Pixbuf(path); } else { if (path.EndsWith(".png")) { icon = WidgetFu.LoadThemeIcon(path.Substring(0, path.Length - 4), size); } else { icon = WidgetFu.LoadThemeIcon(path, size); } if (icon == null) { string kde_path = Beagle.Util.KdeUtils.LookupIcon(path); if (System.IO.File.Exists(kde_path)) { icon = new Gdk.Pixbuf(kde_path); } } } } catch (Exception e) { Console.WriteLine("Unable to load icon '{0}': {1}", path, e.Message); } } if (icon != null) { if (icon.Height > size) { int scaled_width = (int)((double)size / (double)icon.Height * icon.Width); icon = icon.ScaleSimple(scaled_width, size, Gdk.InterpType.Bilinear); } image.Pixbuf = icon; } else { base.LoadIcon(image, size); } }
private void OnUnknownHostFound(object sender, AvahiEventArgs args) { NotificationMessage m = new NotificationMessage(); m.Pixbuf = WidgetFu.LoadThemeIcon("network-workgroup", 48); m.Title = Catalog.GetString("There are computers near you running Beagle"); m.Message = Catalog.GetString("You can select to search other computers from the \"Search\" menu."); m.AddAction("Configure", OnNetworkConfigure); notification_area.Display(m); }
private Gdk.Pixbuf GetIcon(int size) { if (Hit.GetFirstProperty("beagle:Photo") != null) { Gdk.Pixbuf icon = new Gdk.Pixbuf(Hit.GetFirstProperty("beagle:Photo")); return(icon.ScaleSimple(size, size, Gdk.InterpType.Bilinear)); } else { return(WidgetFu.LoadThemeIcon("stock_person", size)); } }
private Hashtable IconsForSize(int size) { Hashtable icons = new Hashtable(); icons ["aim"] = WidgetFu.LoadThemeIcon("im-aim", size); icons ["icq"] = WidgetFu.LoadThemeIcon("im-icq", size); icons ["jabber"] = WidgetFu.LoadThemeIcon("im-jabber", size); icons ["msn"] = WidgetFu.LoadThemeIcon("im-msn", size); icons ["novell"] = WidgetFu.LoadThemeIcon("im-nov", size); icons ["yahoo"] = WidgetFu.LoadThemeIcon("im-yahoo", size); return(icons); }
protected override void LoadIcon(Gtk.Image image, int size) { if (Utils.GetFirstPropertyOfParent(Hit, "fixme:isAnswered") != null) { image.Pixbuf = WidgetFu.LoadThemeIcon("stock_mail-replied", size); } else if (Utils.GetFirstPropertyOfParent(Hit, "fixme:isSeen") != null) { image.Pixbuf = WidgetFu.LoadThemeIcon("stock_mail-open", size); } else { image.Pixbuf = WidgetFu.LoadThemeIcon("stock_mail", size); } }
protected TileFlat(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Subject = WidgetFu.NewLabel(); WidgetFu.EllipsizeLabel(Subject, 40); HBox.PackStart(Subject, true, true, 3); From = WidgetFu.NewLabel(); From.UseMarkup = true; WidgetFu.EllipsizeLabel(From, 20); HBox.PackStart(From, false, false, 3); Date = WidgetFu.NewLabel(); HBox.PackStart(Date, false, false, 3); HBox.ShowAll(); }
public Gtk.Label AddSnippet() { AddNewLine(); snippet = WidgetFu.NewLabel(); snippet.SetAlignment(0.0f, 0.0f); snippet.Selectable = true; WidgetFu.EllipsizeLabel(snippet); snippet.Show(); Attach(snippet, 1, 2, current_row, ++current_row, expand, fill, 0, 0); maximized = false; snippet_tip = new Gtk.Tooltips(); return(snippet); }
protected override void LoadIcon(Gtk.Image image, int size) { // The File tile doesn't respect the icon size because // 48 is too small for thumbnails if (!thumbnailer.SetThumbnailIcon(image, Hit, size)) { base.LoadIcon(image, size); } // FIXME: Multiple emblems string emblem = Hit.GetFirstProperty("nautilus:emblem"); if (String.IsNullOrEmpty(emblem)) { return; } Gdk.Pixbuf emblem_pixbuf = WidgetFu.LoadThemeIcon("emblem-" + emblem, 24); if (emblem_pixbuf == null) { return; } Gdk.Pixbuf icon = image.Pixbuf.Copy(); // If the icon itself is smaller than our requested // emblem, just display the icon. if ((icon.Height < emblem_pixbuf.Height || icon.Width < emblem_pixbuf.Width) || (icon.Height < (emblem_pixbuf.Height * 2) && icon.Width < (emblem_pixbuf.Width * 2))) { icon.Dispose(); emblem_pixbuf.Dispose(); return; } emblem_pixbuf.Composite(icon, 0, 0, emblem_pixbuf.Width, emblem_pixbuf.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, 255); emblem_pixbuf.Dispose(); image.Pixbuf.Dispose(); image.Pixbuf = icon; }
public TileTemplate(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Alignment alignment = new Alignment(0.0f, 0.5f, 1.0f, 0.0f); HBox.PackStart(alignment, true, true, 0); VBox vbox = new VBox(false, 0); alignment.Add(vbox); title_label = WidgetFu.NewLabel(); title_label.LineWrap = true; WidgetFu.EllipsizeLabel(title_label, 30); vbox.PackStart(title_label, false, false, 0); desc_label = WidgetFu.NewGrayLabel(); desc_label.NoShowAll = true; WidgetFu.EllipsizeLabel(desc_label, 30); vbox.PackStart(desc_label, false, false, 0); alignment.ShowAll(); }
protected override void LoadIcon(Gtk.Image image, int size) { image.Pixbuf = WidgetFu.LoadThemeIcon("stock_calendar", size); }
protected override void LoadIcon(Gtk.Image image, int size) { image.Pixbuf = WidgetFu.LoadThemeIcon("gnome-fs-directory", size); }
protected override void LoadIcon(Gtk.Image image, int size) { image.Pixbuf = WidgetFu.LoadThemeIcon("tomboy", size); }
private void DetailsSizeRequested(object obj, Gtk.SizeRequestedArgs args) { if (maximized) { return; } // Add a placeholder widget Gtk.Label label = WidgetFu.NewLabel(""); Attach(label, 0, 2, current_row, ++current_row, fill, expand, 0, 0); Gtk.Table.TableChild[,] children = new Gtk.Table.TableChild[NColumns, NRows]; foreach (Gtk.Widget child in Children) { Gtk.Table.TableChild tc = this[child] as Gtk.Table.TableChild; children[tc.LeftAttach, tc.TopAttach] = tc; } // Expand the icon down to the bottom or the first label if (children[0, 0] != null && children[0, 0].Child == icon) { uint max_icon_row; for (max_icon_row = 1; max_icon_row < NRows; max_icon_row++) { if (children[0, max_icon_row] != null) { break; } } children[0, 0].BottomAttach = max_icon_row; } // Expand all labels (except in column 0) rightward for (uint row = 0; row < NRows; row++) { for (uint col = 1; col < NColumns; col++) { if (children[col, row] == null || !(children[col, row].Child is Gtk.Label)) { continue; } uint end = col + 1; while (end < NColumns && children[end, row] == null) { end++; } if (end > col + 1) { children[col, row].RightAttach = end; } } } // Vertically expand only the placeholder row for (uint row = 0; row < NRows; row++) { for (uint col = 1; col < NColumns; col++) { if (children[col, row] == null) { continue; } children[col, row].YOptions = (row == NRows - 1) ? expand : fill; } } maximized = true; }
public SearchWindow(ISearch search) : base(WindowType.Toplevel) { this.search = search; base.Title = Catalog.GetString("Desktop Search"); base.Icon = WidgetFu.LoadThemeIcon("system-search", 16); base.DefaultWidth = 700; base.DefaultHeight = 550; base.DeleteEvent += OnWindowDelete; VBox vbox = new VBox(); vbox.Spacing = 3; uim = new UIManager(this); uim.DomainChanged += OnDomainChanged; uim.SortChanged += OnSortChanged; uim.ToggleDetails += OnToggleDetails; uim.ShowQuickTips += OnShowQuickTips; uim.ShowIndexInfo += OnShowIndexInfo; uim.StartDaemon += OnStartDaemon; uim.StopDaemon += OnStopDaemon; vbox.PackStart(uim.MenuBar, false, false, 0); HBox hbox = new HBox(false, 6); Label label = new Label(Catalog.GetString("_Find in:")); hbox.PackStart(label, false, false, 0); scope_list = ComboBox.NewText(); foreach (ScopeMapping mapping in scope_mappings) { scope_list.AppendText(mapping.label); } scope_list.Active = 0; scope_list.Changed += new EventHandler(delegate(object o, EventArgs args) { ComboBox combo = o as ComboBox; if (o == null) { return; } int active = combo.Active; Log.Debug("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping); Query(true); }); hbox.PackStart(scope_list, false, false, 0); entry = new Entry(); entry.Activated += OnEntryActivated; hbox.PackStart(entry, true, true, 0); label.MnemonicWidget = entry; uim.FocusSearchEntry += delegate() { entry.GrabFocus(); }; // The auto search after timeout feauture is now optional // and can be disabled. if (Conf.BeagleSearch.GetOption(Conf.Names.BeagleSearchAutoSearch, true)) { entry.Changed += OnEntryResetTimeout; entry.MoveCursor += OnEntryResetTimeout; } button = new Gtk.Button(); Gtk.HBox button_hbox = new Gtk.HBox(false, 2); Gtk.Image icon = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Button); button_hbox.PackStart(icon, false, false, 0); label = new Gtk.Label(Catalog.GetString("Find Now")); button_hbox.PackStart(label, false, false, 0); button.Add(button_hbox); button.Clicked += OnButtonClicked; Gtk.VBox buttonVBox = new Gtk.VBox(false, 0); buttonVBox.PackStart(button, true, false, 0); hbox.PackStart(buttonVBox, false, false, 0); spinner = new Spinner(); hbox.PackStart(spinner, false, false, 0); HBox padding_hbox = new HBox(); padding_hbox.PackStart(hbox, true, true, 9); vbox.PackStart(padding_hbox, false, true, 6); VBox view_box = new VBox(false, 3); vbox.PackStart(view_box, true, true, 0); HBox na_padding = new HBox(); view_box.PackStart(na_padding, false, true, 0); notification_area = new NotificationArea(); na_padding.PackStart(notification_area, true, true, 3); pages = new Gtk.Notebook(); pages.ShowTabs = false; pages.ShowBorder = false; pages.BorderWidth = 3; view_box.PackStart(pages, true, true, 0); quicktips = new Pages.QuickTips(); quicktips.Show(); pages.Add(quicktips); indexinfo = new Pages.IndexInfo(); indexinfo.Show(); pages.Add(indexinfo); rootuser = new Pages.RootUser(); rootuser.Show(); pages.Add(rootuser); startdaemon = new Pages.StartDaemon(); startdaemon.DaemonStarted += OnDaemonStarted; startdaemon.Show(); pages.Add(startdaemon); panes = new Beagle.Search.Panes(); panes.Show(); pages.Add(panes); view = new GroupView(); view.TileSelected += ShowInformation; panes.MainContents = view; this.statusbar = new Gtk.Statusbar(); vbox.PackEnd(this.statusbar, false, false, 0); Add(vbox); tips = new Gtk.Tooltips(); tips.SetTip(entry, Catalog.GetString("Type in search terms"), ""); tips.SetTip(button, Catalog.GetString("Start searching"), ""); tips.Enable(); if (Environment.UserName == "root" && !Conf.Daemon.GetOption(Conf.Names.AllowRoot, false)) { pages.CurrentPage = pages.PageNum(rootuser); entry.Sensitive = button.Sensitive = uim.Sensitive = false; } else { pages.CurrentPage = pages.PageNum(quicktips); } entry.GrabFocus(); StartCheckingIndexingStatus(); }