From 9fe2bb32a3325880c54bfdf35ed7699c2cc32173 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sat, 25 May 2024 23:27:51 +0300 Subject: Kate: display file type icon and tooltip in viewspace (cherry picked from commit b82c8a3f42468101be9518a4f08e0aa5a651b66f) --- kate/app/kateviewspace.cpp | 8 ++++++-- kate/app/kateviewspace.h | 2 +- kate/pics/actions/cr16-action-null.png | Bin 83 -> 0 bytes kate/pics/actions/lo16-action-null.png | Bin 83 -> 0 bytes 4 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 kate/pics/actions/cr16-action-null.png delete mode 100644 kate/pics/actions/lo16-action-null.png (limited to 'kate') diff --git a/kate/app/kateviewspace.cpp b/kate/app/kateviewspace.cpp index 8c552a82f..240d9a810 100644 --- a/kate/app/kateviewspace.cpp +++ b/kate/app/kateviewspace.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include //BEGIN KVSSBSep /* @@ -340,7 +342,6 @@ KateVSStatusBar::KateVSStatusBar ( KateViewSpace *parent, const char *name ) m_modPm = SmallIcon("modified"); m_modDiscPm = SmallIcon("modonhd"); m_modmodPm = SmallIcon("modmod"); - m_noPm = SmallIcon("null"); } KateVSStatusBar::~KateVSStatusBar () @@ -377,6 +378,8 @@ void KateVSStatusBar::updateMod( bool mod ) bool modOnHD = info && info->modifiedOnDisc; + KMimeType::Ptr mime = KMimeType::findByURL(v->getDoc()->url()); + m_modifiedLabel->setPixmap( mod ? info && modOnHD ? @@ -384,8 +387,9 @@ void KateVSStatusBar::updateMod( bool mod ) m_modPm : info && modOnHD ? m_modDiscPm : - m_noPm + mime->pixmap(TDEIcon::Small) ); + TQToolTip::add(this, mime->comment()); } } diff --git a/kate/app/kateviewspace.h b/kate/app/kateviewspace.h index 3b238beb8..fa4ae6c2c 100644 --- a/kate/app/kateviewspace.h +++ b/kate/app/kateviewspace.h @@ -64,7 +64,7 @@ class KateVSStatusBar : public KStatusBar TQLabel* m_insertModeLabel; TQLabel* m_selectModeLabel; KSqueezedTextLabel* m_fileNameLabel; - TQPixmap m_modPm, m_modDiscPm, m_modmodPm, m_noPm; + TQPixmap m_modPm, m_modDiscPm, m_modmodPm; class KateViewSpace *m_viewSpace; }; diff --git a/kate/pics/actions/cr16-action-null.png b/kate/pics/actions/cr16-action-null.png deleted file mode 100644 index c06ca5543..000000000 Binary files a/kate/pics/actions/cr16-action-null.png and /dev/null differ diff --git a/kate/pics/actions/lo16-action-null.png b/kate/pics/actions/lo16-action-null.png deleted file mode 100644 index c06ca5543..000000000 Binary files a/kate/pics/actions/lo16-action-null.png and /dev/null differ -- cgit v1.2.1