~mterry/ubuntu/natty/gnome-shell/wip

« back to all changes in this revision

Viewing changes to js/ui/dash.js

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-10-12 22:44:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091012224400-k91p42yvou07i525
Tags: 2.28.0-0ubuntu1
* New upstream version
* debian/control:
  - updated build requirement
* debian/patches/80_git_change_fix_alt_tab_ressource_usage.patch:
  - git change to fix ressources not being freed on alt-tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
397
397
 
398
398
        let text = new Clutter.Text({ font_name: "Sans 12px",
399
399
                                      color: BRIGHT_TEXT_COLOR,
400
 
                                      text: _("Browse") });
 
400
                                      text: _("More") });
401
401
        this.actor.append(text, Big.BoxPackFlags.NONE);
402
402
 
403
403
        this.actor.connect('button-press-event', Lang.bind(this, function (b, e) {
506
506
            this.backLink.actor.hide();
507
507
    },
508
508
 
 
509
    setMoreLinkVisible : function(visible) {
 
510
        if (visible)
 
511
            this.moreLink.actor.show();
 
512
        else
 
513
            this.moreLink.actor.hide();
 
514
    },
 
515
 
509
516
    setCountText : function(countText) {
510
517
        if (countText == "") {
511
518
            this.countText.hide();
613
620
        /***** Search *****/
614
621
 
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);
618
626
 
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) {
779
789
 
780
790
        this._docsSection = new Section(_("RECENT DOCUMENTS"));
781
791
 
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);
784
794
 
785
795
        this._moreDocsPane = null;
786
796
        this._docsSection.header.moreLink.connect('activated', Lang.bind(this, function (link) {
792
802
           }
793
803
        }));
794
804
 
 
805
        this._docDisplay.connect('changed', Lang.bind(this, function () {
 
806
            this._docsSection.header.setMoreLinkVisible(
 
807
                this._docDisplay.actor.get_children().length > 0);
 
808
        }));
 
809
        this._docDisplay.emit('changed');
 
810
 
795
811
        this.sectionArea.append(this._docsSection.actor, Big.BoxPackFlags.EXPAND);
796
812
 
797
813
        /***** Search Results *****/
871
887
    },
872
888
 
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();
 
899
            }
 
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();
885
909
        }
886
910
    },
887
911