-
-
1241 const COLORREF& text_color=CLR_INVALID,
-
1242 const COLORREF& back_color=CLR_INVALID,
-
1243 unsigned char color_decay=10) {
-
1244 if(back_color == CLR_INVALID) {
-
-
-
1247 abd.cbSize =
sizeof(abd) ;
-
1248 if(!SHAppBarMessage(ABM_GETTASKBARPOS, &abd)) {
-
-
-
-
1252 if(
auto dc = GetDC(NULL)) {
-
-
1254 back_color_ = GetPixel(dc, abd.rc.left + 1, abd.rc.top + 1) ;
-
1255 if(back_color_ == CLR_INVALID) {
-
-
1257 back_color_ = GetSysColor(COLOR_WINDOW) ;
-
-
1259 if(!ReleaseDC(NULL, dc)) {
-
-
-
-
-
-
1265 back_color_ = back_color ;
-
-
-
-
-
1270 unsigned char ash_value = back_gray_color_ ;
-
1271 if(back_gray_color_ < 128) {
-
1272 ash_value =
static_cast<decltype(ash_value)
>(
-
1273 (std::min)(ash_value + color_decay, 255)) ;
-
-
-
1276 ash_value =
static_cast<decltype(ash_value)
>(
-
1277 (std::max)(ash_value - color_decay, 0)) ;
-
-
1279 ash_color_ = RGB(ash_value, ash_value, ash_value) ;
-
-
1281 if(text_color == CLR_INVALID) {
-
1282 text_color_ = GetSysColor(COLOR_WINDOWTEXT) ;
-
1283 if(back_gray_color_ < 128) {
-
-
1285 text_color_ = 0x00FFFFFF & ~text_color_ ;
-
-
-
-
1289 text_color_ = text_color ;
-
-
-
-
-
1294 if(!DeleteObject(back_brush_)) {
-
-
-
-
1298 back_brush_ = CreateSolidBrush(back_color_) ;
-
1299 if(back_brush_ == NULL) {
-
-
-
-
1303 if(!SetClassLongPtr(
-
1304 hwnd_, GCLP_HBRBACKGROUND,
-
1305 reinterpret_cast<LONG_PTR
>(back_brush_))) {
-
-
-
-
-
+
+
+
+
1178 return menus_.front() ;
+
+
+
+
+
+
1186 return menus_.back() ;
+
-
-
-
-
1317 if(icon_data_.cbSize > 0) {
-
1318 if(!Shell_NotifyIconW(NIM_DELETE, &icon_data_)) {
-
-
-
-
-
1323 ZeroMemory(&icon_data_,
sizeof(icon_data_)) ;
-
-
1325 if(icon_path.empty()) {
-
1326 icon_data_.cbSize = 0 ;
-
-
-
-
1330 std::wstring icon_path_wide ;
-
-
+
+
+
+
1194 return menus_.back() ;
+
+
+
+
+
+
1202 return menus_.size() ;
+
+
+
+
+
+
+
+
1216 const std::string& font_name=
"") {
+
1217 NONCLIENTMETRICSW metrics ;
+
1218 metrics.cbSize =
sizeof(metrics) ;
+
+
1220 if(!SystemParametersInfoW(
+
1221 SPI_GETNONCLIENTMETRICS,
+
1222 metrics.cbSize, &metrics, 0)) {
+
+
+
+
1226 auto& logfont = metrics.lfCaptionFont ;
+
1227 if(font_size != 0) {
+
1228 logfont.lfHeight = font_size ;
+
+
+
1231 logfont.lfHeight = 20 ;
+
+
1233 if(font_weight != 0) {
+
1234 logfont.lfWeight = font_weight ;
+
+
+
1237 logfont.lfWeight = FW_MEDIUM ;
+
+
+
1240 if(!font_name.empty()) {
+
1241 std::wstring font_name_wide ;
+
+
+
+
1245 auto& dst = logfont.lfFaceName ;
+
+
1247 if(font_name_wide.size() < LF_FACESIZE) {
+
+
1249 dst, font_name_wide.c_str(), font_name_wide.length()) ;
+
1250 dst[font_name_wide.size()] = L
'\0' ;
+
+
+
+
1254 dst, font_name_wide.c_str(), LF_FACESIZE - 1) ;
+
1255 dst[LF_FACESIZE - 1] = L
'\0' ;
+
+
+
+
1259 auto font = CreateFontIndirectW(&logfont) ;
+
+
+
+
+
1264 menu_font_size_ = std::abs(logfont.lfHeight) ;
+
+
+
+
+
+
+
+
1277 const COLORREF& text_color=CLR_INVALID,
+
1278 const COLORREF& back_color=CLR_INVALID,
+
1279 unsigned char color_decay=10) {
+
1280 if(back_color == CLR_INVALID) {
+
+
+
1283 abd.cbSize =
sizeof(abd) ;
+
1284 if(!SHAppBarMessage(ABM_GETTASKBARPOS, &abd)) {
+
+
+
+
1288 if(
auto dc = GetDC(NULL)) {
+
+
1290 back_color_ = GetPixel(dc, abd.rc.left + 1, abd.rc.top + 1) ;
+
1291 if(back_color_ == CLR_INVALID) {
+
+
1293 back_color_ = GetSysColor(COLOR_WINDOW) ;
+
+
1295 if(!ReleaseDC(NULL, dc)) {
+
+
+
+
+
+
1301 back_color_ = back_color ;
+
+
+
+
+
1306 unsigned char ash_value = back_gray_color_ ;
+
1307 if(back_gray_color_ < 128) {
+
1308 ash_value =
static_cast<decltype(ash_value)
>(
+
1309 (std::min)(ash_value + color_decay, 255)) ;
+
+
+
1312 ash_value =
static_cast<decltype(ash_value)
>(
+
1313 (std::max)(ash_value - color_decay, 0)) ;
+
+
1315 ash_color_ = RGB(ash_value, ash_value, ash_value) ;
+
+
1317 if(text_color == CLR_INVALID) {
+
1318 text_color_ = GetSysColor(COLOR_WINDOWTEXT) ;
+
1319 if(back_gray_color_ < 128) {
+
+
1321 text_color_ = 0x00FFFFFF & ~text_color_ ;
+
+
+
+
1325 text_color_ = text_color ;
+
+
+
+
+
1330 if(!DeleteObject(back_brush_)) {
+
+
-
-
+
1334 back_brush_ = CreateSolidBrush(back_color_) ;
+
1335 if(back_brush_ == NULL) {
-
1339 icon_data_.cbSize =
sizeof(icon_data_) ;
-
1340 icon_data_.hWnd = hwnd_ ;
-
1341 icon_data_.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP ;
-
1342 icon_data_.uCallbackMessage = MESSAGE_ID ;
-
1343 icon_data_.hIcon =
static_cast<HICON
>(
-
-
1345 NULL, icon_path_wide.c_str(),
-
1346 IMAGE_ICON, 0, 0, LR_LOADFROMFILE)) ;
-
1347 wcscpy_s(icon_data_.szTip, app_name_.c_str()) ;
-
1348 icon_data_.dwState = NIS_SHAREDICON ;
-
1349 icon_data_.dwStateMask = NIS_SHAREDICON ;
-
-
1351 if(!Shell_NotifyIconW(NIM_ADD, &icon_data_)) {
-
-
-
-
-
-
+
1339 if(!SetClassLongPtr(
+
1340 hwnd_, GCLP_HBRBACKGROUND,
+
1341 reinterpret_cast<LONG_PTR
>(back_brush_))) {
+
+
+
+
+
+
+
+
+
1353 if(icon_data_.cbSize > 0) {
+
1354 if(!Shell_NotifyIconW(NIM_DELETE, &icon_data_)) {
+
+
+
-
-
1360 static LRESULT CALLBACK callback(
-
-
-
-
-
1365 auto get_instance = [hwnd]() ->
FluentTray* {
-
1366 auto upper_addr = GetWindowLongW(hwnd, 0) ;
-
-
-
+
1359 ZeroMemory(&icon_data_,
sizeof(icon_data_)) ;
+
+
1361 if(icon_path.empty()) {
+
1362 icon_data_.cbSize = 0 ;
+
+
+
+
1366 std::wstring icon_path_wide ;
+
+
+
-
1371 auto lower_addr = GetWindowLongW(hwnd,
sizeof(LONG)) ;
-
-
-
-
-
-
-
-
-
-
1381 if(msg == WM_DESTROY || msg == WM_QUIT || msg == WM_CLOSE) {
-
1382 if(
auto self = get_instance()) {
-
-
-
-
-
1387 else if(msg == WM_ACTIVATE && wparam == WA_INACTIVE) {
-
1388 if(
auto self = get_instance()) {
-
1389 if(!self->hide_menu_window()) {
-
-
-
-
-
-
1395 else if(msg == WM_DRAWITEM) {
-
1396 if(
auto self = get_instance()) {
-
1397 auto item =
reinterpret_cast<LPDRAWITEMSTRUCT
>(lparam) ;
-
1398 auto menu_idx = self->get_menu_index_from_window(item->hwndItem) ;
-
-
-
-
1402 auto& menu = self->menus_[menu_idx] ;
-
1403 if(!menu.draw_menu(item, self->font_)) {
-
-
-
-
-
-
-
1410 else if(msg == WM_CTLCOLORBTN) {
-
1411 if(
auto self = get_instance()) {
-
1412 auto menu_idx = self->get_menu_index_from_window(
reinterpret_cast<HWND
>(lparam)) ;
-
-
1414 return DefWindowProc(hwnd, msg, wparam, lparam) ;
-
-
1416 auto& menu = self->menus_[menu_idx] ;
-
1417 return reinterpret_cast<LRESULT
>(menu.background_brush()) ;
-
-
-
1420 else if(msg == WM_COMMAND) {
-
1421 if(
auto self = get_instance()) {
-
1422 auto menu_idx = self->get_menu_index_from_id(LOWORD(wparam)) ;
-
-
-
-
1426 auto& menu = self->menus_[menu_idx] ;
-
1427 if(!menu.process_click_event()) {
-
-
-
-
1431 if(menu.is_toggleable()) {
-
-
1433 if(!InvalidateRect(menu.window_handle(), NULL, TRUE)) {
-
-
-
-
-
-
-
1440 else if(msg == MESSAGE_ID) {
-
1441 if(
auto self = get_instance()) {
-
1442 if(lparam == WM_LBUTTONUP || lparam == WM_RBUTTONUP) {
-
1443 self->show_menu_window() ;
-
-
-
-
-
-
1449 return DefWindowProc(hwnd, msg, wparam, lparam) ;
-
-
-
1452 int get_menu_index_from_window(HWND hwnd) {
-
-
1454 for(
auto& m : menus_) {
-
1455 if(m.window_handle() == hwnd) {
-
-
-
-
-
-
-
-
1463 int get_menu_index_from_id(WORD
id) {
-
-
1465 for(
auto& m : menus_) {
-
1466 if(m.id() ==
static_cast<std::size_t
>(
id)) {
-
-
-
-
-
-
-
-
1474 void get_message(MSG& message) {
-
1475 if(PeekMessage(&message, hwnd_, 0, 0, PM_REMOVE)) {
-
1476 DispatchMessage(&message) ;
-
-
-
-
1480 void fail() noexcept {
-
-
-
-
1484 bool change_menu_back_color(FluentMenu& menu, COLORREF new_color) {
-
-
1486 text_color_, new_color, ash_color_)) {
-
-
-
-
1490 if(!InvalidateRect(menu.window_handle(), NULL, TRUE)) {
-
-
-
-
-
+
+
+
+
+
1375 icon_data_.cbSize =
sizeof(icon_data_) ;
+
1376 icon_data_.hWnd = hwnd_ ;
+
1377 icon_data_.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP ;
+
1378 icon_data_.uCallbackMessage = MESSAGE_ID ;
+
1379 icon_data_.hIcon =
static_cast<HICON
>(
+
+
1381 NULL, icon_path_wide.c_str(),
+
1382 IMAGE_ICON, 0, 0, LR_LOADFROMFILE)) ;
+
1383 wcscpy_s(icon_data_.szTip, app_name_.c_str()) ;
+
1384 icon_data_.dwState = NIS_SHAREDICON ;
+
1385 icon_data_.dwStateMask = NIS_SHAREDICON ;
+
+
1387 if(!Shell_NotifyIconW(NIM_ADD, &icon_data_)) {
+
+
+
+
+
+
+
+
+
+
1396 static LRESULT CALLBACK callback(
+
+
+
+
+
1401 auto get_instance = [hwnd]() ->
FluentTray* {
+
1402 auto upper_addr = GetWindowLongW(hwnd, 0) ;
+
+
+
+
+
1407 auto lower_addr = GetWindowLongW(hwnd,
sizeof(LONG)) ;
+
+
+
+
+
+
+
+
+
+
1417 if(msg == WM_DESTROY || msg == WM_QUIT || msg == WM_CLOSE) {
+
1418 if(
auto self = get_instance()) {
+
+
+
+
+
1423 else if(msg == WM_ACTIVATE && wparam == WA_INACTIVE) {
+
1424 if(
auto self = get_instance()) {
+
1425 if(!self->hide_menu_window()) {
+
+
+
+
+
+
1431 else if(msg == WM_DRAWITEM) {
+
1432 if(
auto self = get_instance()) {
+
1433 auto item =
reinterpret_cast<LPDRAWITEMSTRUCT
>(lparam) ;
+
1434 auto menu_idx = self->get_menu_index_from_window(item->hwndItem) ;
+
+
+
+
1438 auto& menu = self->menus_[menu_idx] ;
+
1439 if(!menu.draw_menu(item, self->font_)) {
+
+
+
+
+
+
+
1446 else if(msg == WM_CTLCOLORBTN) {
+
1447 if(
auto self = get_instance()) {
+
1448 auto menu_idx = self->get_menu_index_from_window(
reinterpret_cast<HWND
>(lparam)) ;
+
+
1450 return DefWindowProc(hwnd, msg, wparam, lparam) ;
+
+
1452 auto& menu = self->menus_[menu_idx] ;
+
1453 return reinterpret_cast<LRESULT
>(menu.background_brush()) ;
+
+
+
1456 else if(msg == WM_COMMAND) {
+
1457 if(
auto self = get_instance()) {
+
1458 auto menu_idx = self->get_menu_index_from_id(LOWORD(wparam)) ;
+
+
+
+
1462 auto& menu = self->menus_[menu_idx] ;
+
1463 if(!menu.process_click_event()) {
+
+
+
+
1467 if(menu.is_toggleable()) {
+
+
1469 if(!InvalidateRect(menu.window_handle(), NULL, TRUE)) {
+
+
+
+
+
+
+
1476 else if(msg == MESSAGE_ID) {
+
1477 if(
auto self = get_instance()) {
+
1478 if(lparam == WM_LBUTTONUP || lparam == WM_RBUTTONUP) {
+
1479 self->show_menu_window() ;
+
+
+
+
+
+
1485 return DefWindowProc(hwnd, msg, wparam, lparam) ;
+
+
+
1488 int get_menu_index_from_window(HWND hwnd) {
+
+
1490 for(
auto& m : menus_) {
+
1491 if(m.window_handle() == hwnd) {
+
+
+
+
+
+
+
+
1499 int get_menu_index_from_id(WORD
id) {
+
+
1501 for(
auto& m : menus_) {
+
1502 if(m.id() ==
static_cast<std::size_t
>(
id)) {
+
+
+
+
+
+
+
+
1510 void get_message(MSG& message) {
+
1511 if(PeekMessage(&message, hwnd_, 0, 0, PM_REMOVE)) {
+
1512 DispatchMessage(&message) ;
+
+
+
+
1516 void fail() noexcept {
+
+
+
+
1520 bool change_menu_back_color(FluentMenu& menu, COLORREF new_color) {
+
+
1522 text_color_, new_color, ash_color_)) {
+
+
+
+
1526 if(!InvalidateRect(menu.window_handle(), NULL, TRUE)) {
+
+
+
+
+
-
-
-
+
+
+
@@ -1445,29 +1473,33 @@
Class with information on the entire tray.
Definition fluent_tray.hpp:680
virtual ~FluentTray() noexcept
Definition fluent_tray.hpp:744
-
std::vector< FluentMenu >::iterator end() noexcept
Returns an iterator to the end of menus.
Definition fluent_tray.hpp:1143
+
std::vector< FluentMenu >::iterator end() noexcept
Returns an iterator to the end of menus.
Definition fluent_tray.hpp:1145
FluentTray & operator=(const FluentTray &)=delete
-
bool show_menu_window()
Show the menu window above the tray icon.
Definition fluent_tray.hpp:1001
+
bool show_menu_window()
Show the menu window above the tray icon.
Definition fluent_tray.hpp:1006
bool create_tray(const std::string &app_name, const std::string &icon_path="", LONG menu_x_margin=5, LONG menu_y_margin=5, LONG menu_x_pad=5, LONG menu_y_pad=5, unsigned char opacity=255, bool round_corner=true)
Initialize tray and create icon on tray.
Definition fluent_tray.hpp:765
-
void stop() noexcept
Exit the tray successfully.
Definition fluent_tray.hpp:1127
+
void stop() noexcept
Exit the tray successfully.
Definition fluent_tray.hpp:1129
FluentTray & operator=(FluentTray &&)=default
bool add_menu(const std::string &label_text="", const std::string &icon_path="", bool toggleable=false, const std::string &checkmark="✓", const std::function< bool(void)> &callback=[] {return true ;}, const std::function< bool(void)> &unchecked_callback=[] {return true ;})
Add a menu in order from the top.
Definition fluent_tray.hpp:898
-
bool set_font(LONG font_size=0, LONG font_weight=0, const std::string &font_name="")
Set font information to draw menus.
Definition fluent_tray.hpp:1179
-
TrayStatus status() const noexcept
Get the current status of tray.
Definition fluent_tray.hpp:1120
-
bool change_icon(const std::string &icon_path)
Load the image file and change the icon.
Definition fluent_tray.hpp:1316
+
bool set_font(LONG font_size=0, LONG font_weight=0, const std::string &font_name="")
Set font information to draw menus.
Definition fluent_tray.hpp:1213
+
TrayStatus status() const noexcept
Get the current status of tray.
Definition fluent_tray.hpp:1122
+
const FluentMenu & back() const
Returns the const reference to the last of menus.
Definition fluent_tray.hpp:1193
+
bool change_icon(const std::string &icon_path)
Load the image file and change the icon.
Definition fluent_tray.hpp:1352
FluentTray()
Create tray object.
Definition fluent_tray.hpp:714
-
std::size_t count_menus() const noexcept
Returns the number of menus.
Definition fluent_tray.hpp:1167
-
bool update_with_loop(std::chrono::milliseconds sleep_time=std::chrono::milliseconds(1))
Create a message loop to update the tray.
Definition fluent_tray.hpp:971
-
std::vector< FluentMenu >::const_iterator cbegin() const noexcept
Returns a constant iterator to the beginning of menus.
Definition fluent_tray.hpp:1151
-
std::vector< FluentMenu >::const_iterator cend() const noexcept
Returns a constant iterator to the end of menus.
Definition fluent_tray.hpp:1159
-
bool set_color(const COLORREF &text_color=CLR_INVALID, const COLORREF &back_color=CLR_INVALID, unsigned char color_decay=10)
Set colors to draw menus.
Definition fluent_tray.hpp:1240
+
std::size_t count_menus() const noexcept
Returns the number of menus.
Definition fluent_tray.hpp:1201
+
bool update_with_loop(std::chrono::milliseconds sleep_time=std::chrono::milliseconds(1))
Create a message loop to update the tray.
Definition fluent_tray.hpp:976
+
std::vector< FluentMenu >::const_iterator cbegin() const noexcept
Returns a constant iterator to the beginning of menus.
Definition fluent_tray.hpp:1153
+
std::vector< FluentMenu >::const_iterator cend() const noexcept
Returns a constant iterator to the end of menus.
Definition fluent_tray.hpp:1161
+
const FluentMenu & front() const
Returns the const reference to the beginning of menus.
Definition fluent_tray.hpp:1177
+
bool set_color(const COLORREF &text_color=CLR_INVALID, const COLORREF &back_color=CLR_INVALID, unsigned char color_decay=10)
Set colors to draw menus.
Definition fluent_tray.hpp:1276
void add_separator()
Add a separator line under the last menu item added.
Definition fluent_tray.hpp:921
-
bool hide_menu_window()
Hide the menu window above the tray icon.
Definition fluent_tray.hpp:1106
+
bool hide_menu_window()
Hide the menu window above the tray icon.
Definition fluent_tray.hpp:1111
FluentTray(const FluentTray &)=delete
+
FluentMenu & front()
Returns the reference to the beginning of menus.
Definition fluent_tray.hpp:1169
FluentTray(FluentTray &&)=default
-
HWND window_handle() const noexcept
Refer to the handle of menu window.
Definition fluent_tray.hpp:993
-
std::vector< FluentMenu >::iterator begin() noexcept
Returns an iterator to the beginning of menus.
Definition fluent_tray.hpp:1135
+
HWND window_handle() const noexcept
Refer to the handle of menu window.
Definition fluent_tray.hpp:998
+
std::vector< FluentMenu >::iterator begin() noexcept
Returns an iterator to the beginning of menus.
Definition fluent_tray.hpp:1137
bool update()
Get window message and update tray.
Definition fluent_tray.hpp:931
+
FluentMenu & back()
Returns the reference to the last of menus.
Definition fluent_tray.hpp:1185
#define FLUENT_TRAY_MESSAGE_ID_OFFSET
Unique message identifier.
Definition fluent_tray.hpp:82
bool exists(const std::wstring &path)
Checks if the file exists.
Definition fluent_tray.hpp:231
constexpr std::size_t bit2mask(std::size_t bits) noexcept
Generates a mask with the specified number of lower bits set to 1.
Definition fluent_tray.hpp:168
diff --git a/docs/functions.html b/docs/functions.html
index 8d8e478..85216c2 100644
--- a/docs/functions.html
+++ b/docs/functions.html
@@ -83,6 +83,7 @@
- a -
- b -
@@ -113,6 +114,7 @@ - e -
- f -
diff --git a/docs/functions_func.html b/docs/functions_func.html
index a59b803..58fb03b 100644
--- a/docs/functions_func.html
+++ b/docs/functions_func.html
@@ -83,6 +83,7 @@ - a -
- b -
@@ -113,6 +114,7 @@ - e -
- f -
diff --git a/docs/search/all_1.js b/docs/search/all_1.js
index ae790d5..5655109 100644
--- a/docs/search/all_1.js
+++ b/docs/search/all_1.js
@@ -1,7 +1,8 @@
var searchData=
[
- ['background_5fbrush_0',['background_brush',['../classfluent__tray_1_1_fluent_menu.html#ac01651560401f01ca7197ba6d02b2e48',1,'fluent_tray::FluentMenu']]],
- ['begin_1',['begin',['../classfluent__tray_1_1_fluent_tray.html#ae125994bac6b48aa54e0276829983598',1,'fluent_tray::FluentTray']]],
- ['bit2mask_2',['bit2mask',['../namespacefluent__tray_1_1util.html#a342a1de166e89ef94dfd171c84fd2cfe',1,'fluent_tray::util']]],
- ['build_3',['Build',['../index.html#autotoc_md3',1,'']]]
+ ['back_0',['back',['../classfluent__tray_1_1_fluent_tray.html#afce8252232da76937872e263d5fe925f',1,'fluent_tray::FluentTray::back()'],['../classfluent__tray_1_1_fluent_tray.html#a63dfc8e752b444100a525f27b1b96db1',1,'fluent_tray::FluentTray::back() const']]],
+ ['background_5fbrush_1',['background_brush',['../classfluent__tray_1_1_fluent_menu.html#ac01651560401f01ca7197ba6d02b2e48',1,'fluent_tray::FluentMenu']]],
+ ['begin_2',['begin',['../classfluent__tray_1_1_fluent_tray.html#ae125994bac6b48aa54e0276829983598',1,'fluent_tray::FluentTray']]],
+ ['bit2mask_3',['bit2mask',['../namespacefluent__tray_1_1util.html#a342a1de166e89ef94dfd171c84fd2cfe',1,'fluent_tray::util']]],
+ ['build_4',['Build',['../index.html#autotoc_md3',1,'']]]
];
diff --git a/docs/search/all_5.js b/docs/search/all_5.js
index 142ecd7..f9e8794 100644
--- a/docs/search/all_5.js
+++ b/docs/search/all_5.js
@@ -7,5 +7,6 @@ var searchData=
['fluent_5ftray_3a_3autil_4',['util',['../namespacefluent__tray_1_1util.html',1,'fluent_tray']]],
['fluent_5ftray_5fmessage_5fid_5foffset_5',['FLUENT_TRAY_MESSAGE_ID_OFFSET',['../fluent__tray_8hpp.html#a5f249b81cc5c7fbeee48724fbc1ede20',1,'fluent_tray.hpp']]],
['fluentmenu_6',['FluentMenu',['../classfluent__tray_1_1_fluent_menu.html',1,'fluent_tray::FluentMenu'],['../classfluent__tray_1_1_fluent_menu.html#a55a1de08b1e116b71f2225b76fa1a8ff',1,'fluent_tray::FluentMenu::FluentMenu(bool toggleable=false, const std::function< bool(void)> &callback=[] {return true ;}, const std::function< bool(void)> &unchecked_callback=[] {return true ;})'],['../classfluent__tray_1_1_fluent_menu.html#ae65751fe8b47abcae26e99d2cc092c85',1,'fluent_tray::FluentMenu::FluentMenu(const FluentMenu &)=default'],['../classfluent__tray_1_1_fluent_menu.html#a68503bfb45988babdad9d70be8633698',1,'fluent_tray::FluentMenu::FluentMenu(FluentMenu &&)=default']]],
- ['fluenttray_7',['FluentTray',['../classfluent__tray_1_1_fluent_tray.html',1,'fluent_tray::FluentTray'],['../classfluent__tray_1_1_fluent_tray.html#a6a6631acc765ddc89ba36976bbe0175f',1,'fluent_tray::FluentTray::FluentTray()'],['../classfluent__tray_1_1_fluent_tray.html#ac538f9a69ab74ead314a5004f717080f',1,'fluent_tray::FluentTray::FluentTray(const FluentTray &)=delete'],['../classfluent__tray_1_1_fluent_tray.html#adc5d4b971a378080dea22225c0a8e3a1',1,'fluent_tray::FluentTray::FluentTray(FluentTray &&)=default']]]
+ ['fluenttray_7',['FluentTray',['../classfluent__tray_1_1_fluent_tray.html',1,'fluent_tray::FluentTray'],['../classfluent__tray_1_1_fluent_tray.html#a6a6631acc765ddc89ba36976bbe0175f',1,'fluent_tray::FluentTray::FluentTray()'],['../classfluent__tray_1_1_fluent_tray.html#ac538f9a69ab74ead314a5004f717080f',1,'fluent_tray::FluentTray::FluentTray(const FluentTray &)=delete'],['../classfluent__tray_1_1_fluent_tray.html#adc5d4b971a378080dea22225c0a8e3a1',1,'fluent_tray::FluentTray::FluentTray(FluentTray &&)=default']]],
+ ['front_8',['front',['../classfluent__tray_1_1_fluent_tray.html#acd10bcf8769e9851026dd1302323cc90',1,'fluent_tray::FluentTray::front()'],['../classfluent__tray_1_1_fluent_tray.html#a974f39be7c66bf61750de98331b063c3',1,'fluent_tray::FluentTray::front() const']]]
];
diff --git a/docs/search/functions_1.js b/docs/search/functions_1.js
index 3375426..8f3be7b 100644
--- a/docs/search/functions_1.js
+++ b/docs/search/functions_1.js
@@ -1,6 +1,7 @@
var searchData=
[
- ['background_5fbrush_0',['background_brush',['../classfluent__tray_1_1_fluent_menu.html#ac01651560401f01ca7197ba6d02b2e48',1,'fluent_tray::FluentMenu']]],
- ['begin_1',['begin',['../classfluent__tray_1_1_fluent_tray.html#ae125994bac6b48aa54e0276829983598',1,'fluent_tray::FluentTray']]],
- ['bit2mask_2',['bit2mask',['../namespacefluent__tray_1_1util.html#a342a1de166e89ef94dfd171c84fd2cfe',1,'fluent_tray::util']]]
+ ['back_0',['back',['../classfluent__tray_1_1_fluent_tray.html#afce8252232da76937872e263d5fe925f',1,'fluent_tray::FluentTray::back()'],['../classfluent__tray_1_1_fluent_tray.html#a63dfc8e752b444100a525f27b1b96db1',1,'fluent_tray::FluentTray::back() const']]],
+ ['background_5fbrush_1',['background_brush',['../classfluent__tray_1_1_fluent_menu.html#ac01651560401f01ca7197ba6d02b2e48',1,'fluent_tray::FluentMenu']]],
+ ['begin_2',['begin',['../classfluent__tray_1_1_fluent_tray.html#ae125994bac6b48aa54e0276829983598',1,'fluent_tray::FluentTray']]],
+ ['bit2mask_3',['bit2mask',['../namespacefluent__tray_1_1util.html#a342a1de166e89ef94dfd171c84fd2cfe',1,'fluent_tray::util']]]
];
diff --git a/docs/search/functions_5.js b/docs/search/functions_5.js
index 3c9dced..9763fd0 100644
--- a/docs/search/functions_5.js
+++ b/docs/search/functions_5.js
@@ -1,5 +1,6 @@
var searchData=
[
['fluentmenu_0',['FluentMenu',['../classfluent__tray_1_1_fluent_menu.html#a55a1de08b1e116b71f2225b76fa1a8ff',1,'fluent_tray::FluentMenu::FluentMenu(bool toggleable=false, const std::function< bool(void)> &callback=[] {return true ;}, const std::function< bool(void)> &unchecked_callback=[] {return true ;})'],['../classfluent__tray_1_1_fluent_menu.html#ae65751fe8b47abcae26e99d2cc092c85',1,'fluent_tray::FluentMenu::FluentMenu(const FluentMenu &)=default'],['../classfluent__tray_1_1_fluent_menu.html#a68503bfb45988babdad9d70be8633698',1,'fluent_tray::FluentMenu::FluentMenu(FluentMenu &&)=default']]],
- ['fluenttray_1',['FluentTray',['../classfluent__tray_1_1_fluent_tray.html#a6a6631acc765ddc89ba36976bbe0175f',1,'fluent_tray::FluentTray::FluentTray()'],['../classfluent__tray_1_1_fluent_tray.html#ac538f9a69ab74ead314a5004f717080f',1,'fluent_tray::FluentTray::FluentTray(const FluentTray &)=delete'],['../classfluent__tray_1_1_fluent_tray.html#adc5d4b971a378080dea22225c0a8e3a1',1,'fluent_tray::FluentTray::FluentTray(FluentTray &&)=default']]]
+ ['fluenttray_1',['FluentTray',['../classfluent__tray_1_1_fluent_tray.html#a6a6631acc765ddc89ba36976bbe0175f',1,'fluent_tray::FluentTray::FluentTray()'],['../classfluent__tray_1_1_fluent_tray.html#ac538f9a69ab74ead314a5004f717080f',1,'fluent_tray::FluentTray::FluentTray(const FluentTray &)=delete'],['../classfluent__tray_1_1_fluent_tray.html#adc5d4b971a378080dea22225c0a8e3a1',1,'fluent_tray::FluentTray::FluentTray(FluentTray &&)=default']]],
+ ['front_2',['front',['../classfluent__tray_1_1_fluent_tray.html#acd10bcf8769e9851026dd1302323cc90',1,'fluent_tray::FluentTray::front()'],['../classfluent__tray_1_1_fluent_tray.html#a974f39be7c66bf61750de98331b063c3',1,'fluent_tray::FluentTray::front() const']]]
];
diff --git a/include/fluent_tray.hpp b/include/fluent_tray.hpp
index 7ec4271..1b1417f 100644
--- a/include/fluent_tray.hpp
+++ b/include/fluent_tray.hpp
@@ -1162,6 +1162,38 @@ namespace fluent_tray
return menus_.cend() ;
}
+ /**
+ * @brief Returns the reference to the beginning of menus.
+ * @return Reference to the first element.
+ */
+ FluentMenu& front() {
+ return menus_.front() ;
+ }
+
+ /**
+ * @brief Returns the const reference to the beginning of menus.
+ * @return Const reference to the first element.
+ */
+ const FluentMenu& front() const {
+ return menus_.front() ;
+ }
+
+ /**
+ * @brief Returns the reference to the last of menus.
+ * @return Reference to the first element.
+ */
+ FluentMenu& back() {
+ return menus_.back() ;
+ }
+
+ /**
+ * @brief Returns the const reference to the last of menus.
+ * @return Const reference to the first element.
+ */
+ const FluentMenu& back() const {
+ return menus_.back() ;
+ }
+
/**
* @brief Returns the number of menus.
* @return The number of menus.