Skip to content

Commit

Permalink
BoardViewBase: Use PANGO markup to display thread subject (JDimproved…
Browse files Browse the repository at this point in the history
…#1033)

スレ一覧に表示するスレタイトルをPANGO Markupで装飾して表示するように
変更します。

参考文献
https://docs.gtk.org/Pango/pango_markup.html

Co-authored-by: JD Project <jd.project@acc574344b8506f1335297eaa7f74be0f7ea992b>
  • Loading branch information
ma8ma and JD Project committed Aug 20, 2022
1 parent c323b32 commit 3ec7460
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/board/boardviewbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,11 @@ void BoardViewBase::update_columns()
Gtk::CellRenderer *cell = column->get_first_cell();

// 実際の描画の際に cellrendere のプロパティをセットするスロット関数
if( cell ) column->set_cell_data_func( *cell, sigc::mem_fun( *this, &BoardViewBase::slot_cell_data ) );
if( cell ) {
auto slot_func{ id == COL_SUBJECT ? &BoardViewBase::slot_cell_data_markup
: &BoardViewBase::slot_cell_data };
column->set_cell_data_func( *cell, sigc::mem_fun( *this, slot_func ) );
}

Gtk::CellRendererText* rentext = dynamic_cast< Gtk::CellRendererText* >( cell );
if( rentext ){
Expand Down Expand Up @@ -863,6 +867,28 @@ void BoardViewBase::save_column_width()



//
// Subjectの実際の描画の際に cellrenderer のプロパティをセットするスロット関数
//
void BoardViewBase::slot_cell_data_markup( Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& it )
{
Gtk::TreeModel::Row row = *it;

// ハイライト色 ( 抽出状態 )
if( row[ m_columns.m_col_drawbg ] ){
cell->property_cell_background() = CONFIG::get_color( COLOR_BACK_HIGHLIGHT_TREE );
cell->property_cell_background_set() = true;
}

else m_treeview.slot_cell_data( cell, it );

Gtk::CellRendererText* rentext = dynamic_cast<Gtk::CellRendererText*>( cell );
rentext->property_text() = "";
rentext->property_markup() = row[ m_columns.m_col_subject ];
}



//
// 実際の描画の際に cellrendere のプロパティをセットするスロット関数
//
Expand Down
1 change: 1 addition & 0 deletions src/board/boardviewbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ namespace BOARD
// 列の幅の保存
virtual void save_column_width();

void slot_cell_data_markup( Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& it );
void slot_cell_data( Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& it );

// 全ての行の表示内容更新
Expand Down

0 comments on commit 3ec7460

Please sign in to comment.