diff --git a/docs/taskbar.md b/docs/taskbar.md index fe7d50a..7a8076c 100644 --- a/docs/taskbar.md +++ b/docs/taskbar.md @@ -68,7 +68,6 @@ Path: `Nickvision::Taskbar::TaskbarItem` long Count: get, set ``` - The count shown on the taskbar item. - - Note: Setting the count will set the count visible to true if count > 0, else will set count visible to false. ### Methods - ```cpp diff --git a/include/taskbar/taskbaritem.h b/include/taskbar/taskbaritem.h index d96eea3..60595ed 100644 --- a/include/taskbar/taskbaritem.h +++ b/include/taskbar/taskbaritem.h @@ -77,7 +77,7 @@ namespace Nickvision::Taskbar */ long getCount() const; /** - * @brief Sets the count shown on the taskbar item. Setting the count will set the count visible to true if count > 0, else will set count visible to false. + * @brief Sets the count shown on the taskbar item. * @param count The new count value */ void setCount(long count); diff --git a/src/taskbar/taskbaritem.cpp b/src/taskbar/taskbaritem.cpp index df35dce..0da25d8 100644 --- a/src/taskbar/taskbaritem.cpp +++ b/src/taskbar/taskbaritem.cpp @@ -67,7 +67,7 @@ namespace Nickvision::Taskbar void TaskbarItem::setProgress(double progress) { - setProgressState(progress == 0 ? ProgressState::NoProgress : ProgressState::Normal); + setProgressState(progress > 0 ? ProgressState::Normal : ProgressState::NoProgress); std::lock_guard lock{ m_mutex }; m_progress = progress; #ifdef _WIN32 @@ -141,11 +141,13 @@ namespace Nickvision::Taskbar void TaskbarItem::setCount(long count) { - setCountVisible(count > 0); std::lock_guard lock{ m_mutex }; m_count = count; #ifdef _WIN32 - drawCountIcon(); + if(m_countVisible) + { + drawCountIcon(); + } #elif defined(__linux__) sendDBusUpdate(); #endif