Re: getting rid of topbar



On Thu, Jun 2, 2011 at 10:26 AM, Florian Müllner <fmuellner gnome org> wrote:
> Hey,
>
> 2011/6/2 Artur Wroblewski <wrobell pld-linux org>
>>
>> good point. shouldn't some CSS suffice here, i.e. height: 0px or
>> visibility: none?
>
> No, that would only "hide" the panel background - without doing fancy stuff
> like animations, you'll need something along the lines of:
>
> Main.overview.connect('showing', function() {
>     Main.panel.actor.show();
>     Main.panel._leftCorner.actor.show();
>    Main.panel._rightCorner.actor.show();
> });
> Main.overview.connect('hidden', function() {
>     Main.panel.actor.hide();
>     Main.panel._leftCorner.actor.hide();
>     Main.panel._rightCorner.actor.hide();
> });

As my response to above is lost in some limbo (probably due to
binary attachment)...

Above is not working as expected - when a window is maximized,
then you have empty space left, which height is size of topbar's
height.

I looked into autohide topbar extension by Finnbarr P. Murphy
and the following code works

-------------------
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;

const PANEL_HEIGHT = 25;
const HIDE_ANIMATION_TIME = 0.1;

function _hidePanel() {
    Tweener.addTween(Main.panel.actor,
                 { height: 1,
                   time: HIDE_ANIMATION_TIME,
                   transition: 'easeOutQuad'
                 });

    Tweener.addTween(Main.panel._leftCorner.actor,
                 { y: 0,
                   time: HIDE_ANIMATION_TIME,
                   transition: 'easeOutQuad'
                 });

    Tweener.addTween(Main.panel._rightCorner.actor,
                 { y: 0,
                   time: HIDE_ANIMATION_TIME,
                   transition: 'easeOutQuad'
                 });

    Tweener.addTween(Main.panel._boxContainer,
                 { opacity: 0,
                   time: HIDE_ANIMATION_TIME,
                   transition: 'easeOutQuad'
                 });
}

function _showPanel() {
    Tweener.addTween(Main.panel._leftCorner.actor,
                 { y: PANEL_HEIGHT -1,
                   time: HIDE_ANIMATION_TIME+0.2,
                   transition: 'easeOutQuad'
                 });

    Tweener.addTween(Main.panel._rightCorner.actor,
                 { y: PANEL_HEIGHT -1,
                   time: HIDE_ANIMATION_TIME+0.2,
                   transition: 'easeOutQuad'
                 });

    Tweener.addTween(Main.panel._boxContainer,
                 { opacity: 255,
                   time: HIDE_ANIMATION_TIME+0.2,
                   transition: 'easeOutQuad'
                 });

    Tweener.addTween(Main.panel.actor,
                 { height: PANEL_HEIGHT,
                   time: HIDE_ANIMATION_TIME,
                   transition: 'easeOutQuad'
                 });
}

function main() {
    _hidePanel()
    Main.overview.connect('showing', _showPanel);
    Main.overview.connect('hiding', _hidePanel);

}

-------------------

It is quite worrying that simple Main.panel.actor.hide is
not enough. Why hackery involving subcomponents of
topbar is required? (I don't care about animations and
so on)

Any tips how to simplify the code above? Or should I report
a bug about Main.panel.actor.hide?

Best regards,

w


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]