import { CursorShape , Direction , QBoxLayout , QCursor , QLabel , QPushButton , WidgetEventTypes , } from '@nodegui/nodegui' ; export class DChannelButton extends QPushButton { layout = new QBoxLayout ( Direction . LeftToRight ) ; labels : QLabel [ ] = [ ] ; private _hovered = false ; private _activated = false ; private _unread = false ; private _muted = false ; constructor ( parent ) { super ( parent ) ; this . setObjectName ( 'DChannelButton' ) ; this . setLayout ( this . layout ) ; this . layout . setContentsMargins ( 8 , 4 , 8 , 4 ) ; this . setCursor ( new QCursor ( CursorShape . PointingHandCursor ) ) ; this . addEventListener ( WidgetEventTypes . HoverEnter , ( ) => this . setHovered ( true ) ) ; this . addEventListener ( WidgetEventTypes . HoverLeave , ( ) => this . setHovered ( false ) ) ; } muted ( ) { return this . _muted ; } setMuted ( muted ) { if ( this . native . destroyed ) { return ; } this . _muted = muted ; this . setProperty ( 'muted' , muted ) ; [ this , ... this . labels ] . forEach ( ( w ) => w . repolish ( ) ) ; } unread ( ) { return this . _unread ; } setUnread ( unread ) { if ( this . native . destroyed ) { return ; } this . _unread = unread ; this . setProperty ( 'unread' , unread ) ; [ this , ... this . labels ] . forEach ( ( w ) => w . repolish ( ) ) ; } hovered ( ) { return this . _hovered ; } setHovered ( hovered ) { if ( this . native . destroyed ) { return ; } this . _hovered = hovered ; this . setProperty ( 'hover' , hovered ) ; [ this , ... this . labels ] . forEach ( ( w ) => w . repolish ( ) ) ; } activated ( ) { return this . _activated ; } setActivated ( activated ) { if ( this . native . destroyed ) { return ; } this . _activated = activated ; this . setProperty ( 'active' , activated ) ; [ this , ... this . labels ] . forEach ( ( w ) => w . repolish ( ) ) ; } }