Skip to content

Commit

Permalink
afwatch: render: hw info font (not bold)
Browse files Browse the repository at this point in the history
  • Loading branch information
timurhai committed Feb 6, 2024
1 parent 2dca237 commit 28f9a78
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions afanasy/src/libafqt/qenvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ QString QEnvironment::ms_themes_folder;

QFont QEnvironment::f_name;
QFont QEnvironment::f_info;
QFont QEnvironment::f_thin;
QFont QEnvironment::f_muted;
QFont QEnvironment::f_plotter;
QFont QEnvironment::f_min;
Expand Down Expand Up @@ -374,6 +375,9 @@ void QEnvironment::initFonts()
f_info.setBold( true );
f_info.setPointSize( font_sizeinfo.n );

f_thin.setBold( false );
f_thin.setPointSize( font_sizeinfo.n );

f_muted.setItalic( true );
f_muted.setPointSize( font_sizeinfo.n );

Expand Down
1 change: 1 addition & 0 deletions afanasy/src/libafqt/qenvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class afqt::QEnvironment

static QFont f_name;
static QFont f_info;
static QFont f_thin;
static QFont f_muted;
static QFont f_plotter;
static QFont f_min;
Expand Down
14 changes: 10 additions & 4 deletions afanasy/src/watch/itemrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,16 @@ void ItemRender::v_paint(QPainter * i_painter, const QRect & i_rect, const QStyl
return;
}

QRect rect;
switch (afqt::QEnvironment::render_item_size.n)
{
case ListRenders::ESmallSize:
i_painter->setPen(clrTextInfo(i_option));
i_painter->setFont(afqt::QEnvironment::f_info);
i_painter->drawText(left_text_x, y_cur, left_text_w, h, Qt::AlignTop | Qt::AlignLeft,
m_name + ' ' + m_capacity_usage + ' ' + m_loggedin_users + ' ' + m_engine + ' ' + m_hw_info);
i_painter->drawText(left_text_x, y_cur, left_text_w, h, Qt::AlignTop | Qt::AlignLeft, m_name, &rect);
i_painter->setFont(afqt::QEnvironment::f_thin);
i_painter->drawText(left_text_x + rect.width()+5, y_cur-1, left_text_w, h, Qt::AlignTop | Qt::AlignLeft,
m_capacity_usage + ' ' + m_loggedin_users + ' ' + m_engine + ' ' + m_hw_info);

i_painter->setPen(clrTextInfo(i_option));
i_painter->setFont(afqt::QEnvironment::f_info);
Expand All @@ -794,15 +797,18 @@ void ItemRender::v_paint(QPainter * i_painter, const QRect & i_rect, const QStyl
default:
i_painter->setPen(clrTextMain(i_option));
i_painter->setFont(afqt::QEnvironment::f_name);
i_painter->drawText(left_text_x, y_cur, left_text_w, h, Qt::AlignTop | Qt::AlignLeft, m_name + ' ' + m_engine + ' ' + m_hw_info);
i_painter->drawText(left_text_x, y_cur, left_text_w, h, Qt::AlignTop | Qt::AlignLeft, m_name, &rect);

i_painter->setFont(afqt::QEnvironment::f_thin);
i_painter->drawText(left_text_x + rect.width()+5, y_cur, left_text_w, h, Qt::AlignTop | Qt::AlignLeft, m_hw_info + ' ' + m_engine);

i_painter->setPen(afqt::QEnvironment::qclr_black );
i_painter->setFont(afqt::QEnvironment::f_info);
i_painter->drawText(right_text_x, y_cur+2, right_text_w, h, Qt::AlignTop | Qt::AlignRight, ann_state );

i_painter->setPen(clrTextInfo(i_option));
i_painter->setFont(afqt::QEnvironment::f_info);
i_painter->drawText(left_text_x, y_cur, left_text_w, base_height+2, Qt::AlignBottom | Qt::AlignLeft, m_capacity_usage + ' ' + m_loggedin_users);
i_painter->drawText(left_text_x, y_cur, left_text_w, base_height+2, Qt::AlignBottom | Qt::AlignLeft, m_capacity_usage + ' ' + m_loggedin_users);
}

// Print Bottom|Right
Expand Down

0 comments on commit 28f9a78

Please sign in to comment.