Skip to content

Commit 344b56a

Browse files
authored
[email protected]: Word wrap for artist and title labels (#11756)
1 parent 720cb81 commit 344b56a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

files/usr/share/cinnamon/applets/[email protected]/applet.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const Tooltips = imports.ui.tooltips;
1414
const Main = imports.ui.main;
1515
const Settings = imports.ui.settings;
1616
const Slider = imports.ui.slider;
17+
const Pango = imports.gi.Pango;
1718

1819
const MEDIA_PLAYER_2_PATH = "/org/mpris/MediaPlayer2";
1920
const MEDIA_PLAYER_2_NAME = "org.mpris.MediaPlayer2";
@@ -552,11 +553,17 @@ class Player extends PopupMenu.PopupMenuSection {
552553
let artistInfo = new St.BoxLayout();
553554
let artistIcon = new St.Icon({ icon_type: St.IconType.SYMBOLIC, icon_name: "system-users", style_class: 'popup-menu-icon' });
554555
this.artistLabel = new St.Label({text:this._artist});
556+
this.artistLabel.clutterText.line_wrap = true;
557+
this.artistLabel.clutterText.line_wrap_mode = Pango.WrapMode.WORD_CHAR;
558+
this.artistLabel.clutterText.ellipsize = Pango.EllipsizeMode.NONE;
555559
artistInfo.add_actor(artistIcon);
556560
artistInfo.add_actor(this.artistLabel);
557561
let titleInfo = new St.BoxLayout();
558562
let titleIcon = new St.Icon({ icon_type: St.IconType.SYMBOLIC, icon_name: "audio-x-generic", style_class: 'popup-menu-icon' });
559563
this.titleLabel = new St.Label({text:this._title});
564+
this.titleLabel.clutterText.line_wrap = true;
565+
this.titleLabel.clutterText.line_wrap_mode = Pango.WrapMode.WORD_CHAR;
566+
this.titleLabel.clutterText.ellipsize = Pango.EllipsizeMode.NONE;
560567
titleInfo.add_actor(titleIcon);
561568
titleInfo.add_actor(this.titleLabel);
562569
this.trackInfo.add_actor(artistInfo);

0 commit comments

Comments
 (0)