398
398
let text = new Clutter.Text({ font_name: "Sans 12px",
399
399
color: BRIGHT_TEXT_COLOR,
400
text: _("Browse") });
401
401
this.actor.append(text, Big.BoxPackFlags.NONE);
403
403
this.actor.connect('button-press-event', Lang.bind(this, function (b, e) {
506
506
this.backLink.actor.hide();
509
setMoreLinkVisible : function(visible) {
511
this.moreLink.actor.show();
513
this.moreLink.actor.hide();
509
516
setCountText : function(countText) {
510
517
if (countText == "") {
511
518
this.countText.hide();
613
620
/***** Search *****/
615
622
this._searchActive = false;
623
this._searchPending = false;
616
624
this._searchEntry = new SearchEntry();
617
625
this.searchArea.append(this._searchEntry.actor, Big.BoxPackFlags.EXPAND);
620
628
this._searchEntry.entry.connect('text-changed', Lang.bind(this, function (se, prop) {
621
629
let text = this._searchEntry.getText();
622
630
text = text.replace(/^\s+/g, "").replace(/\s+$/g, "")
631
let searchPreviouslyActive = this._searchActive;
623
632
this._searchActive = text != '';
633
this._searchPending = this._searchActive && !searchPreviouslyActive;
624
634
this._updateDashActors();
625
635
if (!this._searchActive) {
626
636
if (this._searchTimeoutId > 0) {
780
790
this._docsSection = new Section(_("RECENT DOCUMENTS"));
782
let docDisplay = new DocDisplay.DashDocDisplay();
783
this._docsSection.content.append(docDisplay.actor, Big.BoxPackFlags.EXPAND);
792
this._docDisplay = new DocDisplay.DashDocDisplay();
793
this._docsSection.content.append(this._docDisplay.actor, Big.BoxPackFlags.EXPAND);
785
795
this._moreDocsPane = null;
786
796
this._docsSection.header.moreLink.connect('activated', Lang.bind(this, function (link) {
805
this._docDisplay.connect('changed', Lang.bind(this, function () {
806
this._docsSection.header.setMoreLinkVisible(
807
this._docDisplay.actor.get_children().length > 0);
809
this._docDisplay.emit('changed');
795
811
this.sectionArea.append(this._docsSection.actor, Big.BoxPackFlags.EXPAND);
797
813
/***** Search Results *****/
873
889
_updateDashActors: function() {
874
if (!this._searchActive && this._searchResultsSection.actor.visible) {
890
if (this._searchPending) {
891
this._searchResultsSection.actor.show();
892
// We initially hide all sections when we start a search. When the search timeout
893
// first runs, the sections that have matching results are shown. As the search
894
// is refined, only the sections that have matching results will be shown.
895
for (let i = 0; i < this._searchSections.length; i++) {
896
let section = this._searchSections[i];
897
section.header.actor.hide();
898
section.resultArea.actor.hide();
900
this._appsSection.actor.hide();
901
this._placesSection.actor.hide();
902
this._docsSection.actor.hide();
903
} else if (!this._searchActive) {
875
904
this._showAllSearchSections();
876
905
this._searchResultsSection.actor.hide();
877
906
this._appsSection.actor.show();
878
907
this._placesSection.actor.show();
879
908
this._docsSection.actor.show();
880
} else if (this._searchActive && !this._searchResultsSection.actor.visible) {
881
this._searchResultsSection.actor.show();
882
this._appsSection.actor.hide();
883
this._placesSection.actor.hide();
884
this._docsSection.actor.hide();