# include "controls.hpp"
QFrame * horizontal_line ( QWidget * parent ) {
QFrame * line = new QFrame ( parent ) ;
line - > setFrameShape ( QFrame : : StyledPanel ) ;
line - > setStyleSheet ( R " (
margin - left : 40 px ;
margin - right : 40 px ;
border - width : 1 px ;
border - bottom - style : solid ;
border - color : gray ;
) " );
line - > setFixedHeight ( 2 ) ;
return line ;
}
AbstractControl : : AbstractControl ( const QString & title , const QString & desc , const QString & icon ) : QFrame ( ) {
hlayout = new QHBoxLayout ;
hlayout - > setMargin ( 0 ) ;
hlayout - > setSpacing ( 50 ) ;
// left icon
if ( ! icon . isEmpty ( ) ) {
QPixmap pix ( icon ) ;
QLabel * icon = new QLabel ( ) ;
icon - > setPixmap ( pix . scaledToWidth ( 80 , Qt : : SmoothTransformation ) ) ;
icon - > setSizePolicy ( QSizePolicy ( QSizePolicy : : Fixed , QSizePolicy : : Fixed ) ) ;
hlayout - > addWidget ( icon ) ;
}
// title
title_label = new QLabel ( title ) ;
title_label - > setStyleSheet ( " font-size: 50px; font-weight: 400; " ) ;
hlayout - > addWidget ( title_label ) ;
setLayout ( hlayout ) ;
}