gnome/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js
/**
 * This function is used for both extendShowAppsIcon and extendDashItemContainer
 */
This function is used for both extendShowAppsIcon and extendDashItemContainer
This function is used for both extendShowAppsIcon and extendDashItemContainer
function itemShowLabel()  {
    if (!this._labelText || this.label.get_stage() == null)
      return;
    this.label.set_text(this._labelText);
    this.label.opacity = 0;
    this.label.show();
    let [stageX, stageY] = this.get_transformed_position();
    let node = this.label.get_theme_node();
    let itemWidth  = this.allocation.x2 - this.allocation.x1;
    let itemHeight = this.allocation.y2 - this.allocation.y1;
    let labelWidth = this.label.get_width();
    let labelHeight = this.label.get_height();
    let x, y, xOffset, yOffset;
    let position = Utils.getPosition();
    this._isHorizontal = ((position == St.Side.TOP) || (position == St.Side.BOTTOM));
    let labelOffset = node.get_length('-x-offset');
    switch (position) {
    case St.Side.LEFT:
        yOffset = Math.floor((itemHeight - labelHeight) / 2);
        y = stageY + yOffset;
        xOffset = labelOffset;
        x = stageX + this.get_width() + xOffset;
        break;
    case St.Side.RIGHT:
        yOffset = Math.floor((itemHeight - labelHeight) / 2);
        y = stageY + yOffset;
        xOffset = labelOffset;
        x = Math.round(stageX) - labelWidth - xOffset;
        break;
    case St.Side.TOP:
        y = stageY + labelOffset + itemHeight;
        xOffset = Math.floor((itemWidth - labelWidth) / 2);
        x = stageX + xOffset;
        break;
    case St.Side.BOTTOM:
        yOffset = labelOffset;
        y = stageY - labelHeight - yOffset;
        xOffset = Math.floor((itemWidth - labelWidth) / 2);
        x = stageX + xOffset;
        break;
    }
    let gap = 5;
    let monitor = Main.layoutManager.findMonitorForActor(this);
    if (x - monitor.x < gap)
        x += monitor.x - x + labelOffset;
    else if (x + labelWidth > monitor.x + monitor.width - gap)
        x -= x + labelWidth - (monitor.x + monitor.width) + gap;
    this.label.remove_all_transitions();
    this.label.set_position(x, y);
    this.label.ease({
        opacity: 255,
        duration: Dash.DASH_ITEM_LABEL_SHOW_TIME,
        mode: Clutter.AnimationMode.EASE_OUT_QUAD
    });
}
function itemShowLabel ( ) { if ( ! this . _labelText || this . label . get_stage ( ) == null ) return ; this . label . set_text ( this . _labelText ) ; this . label . opacity = 0 ; this . label . show ( ) ; let [ stageX , stageY ] = this . get_transformed_position ( ) ; let node = this . label . get_theme_node ( ) ; let itemWidth = this . allocation . x2 - this . allocation . x1 ; let itemHeight = this . allocation . y2 - this . allocation . y1 ; let labelWidth = this . label . get_width ( ) ; let labelHeight = this . label . get_height ( ) ; let x , y , xOffset , yOffset ; let position = Utils . getPosition ( ) ; this . _isHorizontal = ( ( position == St . Side . TOP ) || ( position == St . Side . BOTTOM ) ) ; let labelOffset = node . get_length ( '-x-offset' ) ; switch ( position ) { case St . Side . LEFT : yOffset = Math . floor ( ( itemHeight - labelHeight ) / 2 ) ; y = stageY + yOffset ; xOffset = labelOffset ; x = stageX + this . get_width ( ) + xOffset ; break ; case St . Side . RIGHT : yOffset = Math . floor ( ( itemHeight - labelHeight ) / 2 ) ; y = stageY + yOffset ; xOffset = labelOffset ; x = Math . round ( stageX ) - labelWidth - xOffset ; break ; case St . Side . TOP : y = stageY + labelOffset + itemHeight ; xOffset = Math . floor ( ( itemWidth - labelWidth ) / 2 ) ; x = stageX + xOffset ; break ; case St . Side . BOTTOM : yOffset = labelOffset ; y = stageY - labelHeight - yOffset ; xOffset = Math . floor ( ( itemWidth - labelWidth ) / 2 ) ; x = stageX + xOffset ; break ; } let gap = 5 ; let monitor = Main . layoutManager . findMonitorForActor ( this ) ; if ( x - monitor . x < gap ) x += monitor . x - x + labelOffset ; else if ( x + labelWidth > monitor . x + monitor . width - gap ) x -= x + labelWidth - ( monitor . x + monitor . width ) + gap ; this . label . remove_all_transitions ( ) ; this . label . set_position ( x , y ) ; this . label . ease ( { opacity : 255 , duration : Dash . DASH_ITEM_LABEL_SHOW_TIME , mode : Clutter . AnimationMode . EASE_OUT_QUAD } ) ; }
This function is used for both extendShowAppsIcon and extendDashItemContainer
This function is used for both extendShowAppsIcon and extendDashItemContainer
// Check if the label is still present at all. When switching workpaces, the // item might have been destroyed in between. // keep the label inside the screen border // Only needed fot the x coordinate. // Leave a few pixel gap