Skip to content

Instantly share code, notes, and snippets.

@danigm
Created May 6, 2022 10:27
Show Gist options
  • Save danigm/7897fbc06a8c700237753403b406554f to your computer and use it in GitHub Desktop.
Save danigm/7897fbc06a8c700237753403b406554f to your computer and use it in GitHub Desktop.
const {
Clutter, Pango, St
} = imports.gi;
var _updateMultiline = imports.ui.appDisplay.AppViewItem.prototype._updateMultiline;
var _init = imports.ui.appDisplay.AppViewItem.prototype._init;
var { AppViewItem } = imports.ui.appDisplay;
function init() {
}
function enable() {
// Patched version of original function from:
// https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/appDisplay.js#L1951-1978
AppViewItem.prototype._updateMultiline = function() {
const { label } = this.icon;
const { clutterText } = label;
clutterText.set({
line_wrap: true,
line_wrap_mode: Pango.WrapMode.WORD_CHAR,
ellipsize: false,
});
}
AppViewItem.prototype._init = function(params = {}, isDraggable = true, expandTitleOnHover = true) {
_init.bind(this)(params, isDraggable, expandTitleOnHover);
this._updateMultiline();
}
}
function disable() {
AppViewItem.prototype._updateMultiline = _updateMultiline;
AppViewItem.prototype._init = _init;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment