Skip to content

Commit 731e1c8

Browse files
committed
other change because of c++20 char8_t
1 parent 4299385 commit 731e1c8

14 files changed

+160
-91
lines changed

common/calibration-model.cpp

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ void calibration_model::d400_update(ux_window& window, std::string& error_messag
286286
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
287287

288288
ImGui::SetCursorPosX(w / 2 - 260 / 2);
289-
if (ImGui::Button(u8"\uF07C Load...", ImVec2(70, 30)))
289+
std::string load_str = std::string(rsutils::string::from() << textual_icons::folder_open << " Load...");
290+
if (ImGui::Button(load_str.c_str(), ImVec2(70, 30)))
290291
{
291292
try
292293
{
@@ -338,7 +339,8 @@ void calibration_model::d400_update(ux_window& window, std::string& error_messag
338339
RsImGui::CustomTooltip("%s", "Load calibration from file");
339340
}
340341
ImGui::SameLine();
341-
if (ImGui::Button(u8"\uF0C7 Save As...", ImVec2(100, 30)))
342+
std::string save_str = std::string(rsutils::string::from() << textual_icons::folder_open << " Save As...");
343+
if (ImGui::Button(save_str.c_str(), ImVec2(100, 30)))
342344
{
343345
try
344346
{
@@ -396,7 +398,8 @@ void calibration_model::d400_update(ux_window& window, std::string& error_messag
396398
ImGui::SameLine();
397399
if (_accept)
398400
{
399-
if (ImGui::Button(u8"\uF275 Restore Factory", ImVec2(120, 30)))
401+
std::string restore_str = std::string(rsutils::string::from() << textual_icons::folder_open << " Restore Factory");
402+
if (ImGui::Button(restore_str.c_str(), ImVec2(120, 30)))
400403
{
401404
try
402405
{
@@ -430,7 +433,8 @@ void calibration_model::d400_update(ux_window& window, std::string& error_messag
430433
ImGui::PushStyleColor(ImGuiCol_Text, grey);
431434
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, grey);
432435

433-
ImGui::Button(u8"\uF275 Restore Factory", ImVec2(120, 30));
436+
std::string restore_str = std::string(rsutils::string::from() << textual_icons::folder_open << " Restore Factory");
437+
ImGui::Button(restore_str.c_str(), ImVec2(120, 30));
434438
if (ImGui::IsItemHovered())
435439
{
436440
RsImGui::CustomTooltip("%s", "Write selected calibration table to the device. For advanced users");
@@ -549,7 +553,8 @@ void calibration_model::d400_update(ux_window& window, std::string& error_messag
549553
auto streams = depth_sensor.get_active_streams();
550554
if (_accept && streams.size())
551555
{
552-
if (ImGui::Button(u8"\uF2DB Write Table", ImVec2(120, 25)))
556+
std::string write_str = std::string(rsutils::string::from() << textual_icons::microchip << " Write Table");
557+
if (ImGui::Button(write_str.c_str(), ImVec2(120, 25)))
553558
{
554559
try
555560
{
@@ -580,7 +585,8 @@ void calibration_model::d400_update(ux_window& window, std::string& error_messag
580585
ImGui::PushStyleColor(ImGuiCol_Text, grey);
581586
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, grey);
582587

583-
ImGui::Button(u8"\uF2DB Write Table", ImVec2(120, 25));
588+
std::string write_str = std::string(rsutils::string::from() << textual_icons::microchip << " Write Table");
589+
ImGui::Button(write_str.c_str(), ImVec2(120, 25));
584590
if (ImGui::IsItemHovered())
585591
{
586592
RsImGui::CustomTooltip("%s", "Write selected calibration table to the device. Requires \"Stereo Module\" stream to be on.For advanced users");
@@ -656,7 +662,8 @@ void calibration_model::d500_update( ux_window & window, std::string & error_mes
656662
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
657663

658664
ImGui::SetCursorPosX(w / 2 - 260 / 2);
659-
if (ImGui::Button(u8"\uF07C Load...", ImVec2(70, 30)))
665+
std::string load_str = std::string(rsutils::string::from() << textual_icons::folder_open << " Load...");
666+
if (ImGui::Button(load_str.c_str(), ImVec2(70, 30)))
660667
{
661668
try
662669
{
@@ -716,7 +723,8 @@ void calibration_model::d500_update( ux_window & window, std::string & error_mes
716723
RsImGui::CustomTooltip("%s", "Load calibration from file");
717724
}
718725
ImGui::SameLine();
719-
if (ImGui::Button(u8"\uF0C7 Save As...", ImVec2(100, 30)))
726+
std::string save_str = std::string(rsutils::string::from() << textual_icons::folder_open << " Save As...");
727+
if (ImGui::Button(save_str.c_str(), ImVec2(100, 30)))
720728
{
721729
try
722730
{
@@ -775,7 +783,8 @@ void calibration_model::d500_update( ux_window & window, std::string & error_mes
775783
ImGui::SameLine();
776784
if (_accept)
777785
{
778-
if (ImGui::Button(u8"\uF275 Restore Factory", ImVec2(120, 30)))
786+
std::string restore_str = std::string(rsutils::string::from() << textual_icons::industry << " Restore Factory");
787+
if (ImGui::Button(restore_str.c_str(), ImVec2(120, 30)))
779788
{
780789
try
781790
{
@@ -809,7 +818,8 @@ void calibration_model::d500_update( ux_window & window, std::string & error_mes
809818
ImGui::PushStyleColor(ImGuiCol_Text, grey);
810819
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, grey);
811820

812-
ImGui::Button(u8"\uF275 Restore Factory", ImVec2(120, 30));
821+
std::string restore_str = std::string(rsutils::string::from() << textual_icons::industry << " Restore Factory");
822+
ImGui::Button(restore_str.c_str(), ImVec2(120, 30));
813823
if (ImGui::IsItemHovered())
814824
{
815825
RsImGui::CustomTooltip("%s", "Write selected calibration table to the device. For advanced users");
@@ -899,7 +909,8 @@ void calibration_model::d500_update( ux_window & window, std::string & error_mes
899909

900910
if (_accept)
901911
{
902-
if (ImGui::Button(u8"\uF2DB Write Table", ImVec2(120, 25)))
912+
std::string write_str = std::string(rsutils::string::from() << textual_icons::microchip << " Write Table");
913+
if (ImGui::Button(write_str.c_str(), ImVec2(120, 25)))
903914
{
904915
try
905916
{
@@ -930,7 +941,8 @@ void calibration_model::d500_update( ux_window & window, std::string & error_mes
930941
ImGui::PushStyleColor(ImGuiCol_Text, grey);
931942
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, grey);
932943

933-
ImGui::Button(u8"\uF2DB Write Table", ImVec2(120, 25));
944+
std::string write_str = std::string(rsutils::string::from() << textual_icons::microchip << " Write Table");
945+
ImGui::Button(write_str.c_str(), ImVec2(120, 25));
934946
if (ImGui::IsItemHovered())
935947
{
936948
RsImGui::CustomTooltip("%s", "Write selected calibration table to the device. For advanced users");

common/d500-on-chip-calib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ namespace rs2
355355

356356
ImGui::SetCursorScreenPos({ float(x + 10), float(y + 35) });
357357
ImGui::PushFont(win.get_large_font());
358-
std::string txt = rsutils::string::from() << textual_icons::throphy;
358+
std::string txt = rsutils::string::from() << textual_icons::trophy;
359359
ImGui::Text("%s", txt.c_str());
360360
ImGui::PopFont();
361361

common/device-model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,7 @@ namespace rs2
22712271
{
22722272
std::string desc = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR);
22732273
ss.str("");
2274-
ss << " " << textual_icons::usb_type << " " << desc;
2274+
ss << " " << textual_icons::usb << " " << desc;
22752275
ImGui::SameLine();
22762276
if (!starts_with(desc, "3.")) ImGui::PushStyleColor(ImGuiCol_Text, yellow);
22772277
else ImGui::PushStyleColor(ImGuiCol_Text, light_grey);

common/device-model.h

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ namespace rs2
9898
{
9999
template<typename CharT, std::size_t N>
100100
explicit constexpr textual_icon(const CharT(&unicode_icon)[N])
101-
: _icon{ unicode_icon[0], unicode_icon[1], unicode_icon[2], unicode_icon[3], '\0' }
101+
: _icon{ * reinterpret_cast<const char*>(&unicode_icon[0])
102+
, * reinterpret_cast<const char*>(&unicode_icon[1])
103+
, * reinterpret_cast<const char*>(&unicode_icon[2])
104+
, * reinterpret_cast<const char*>(&unicode_icon[3]), '\0' }
102105
{
103106
}
104107

@@ -215,59 +218,86 @@ namespace rs2
215218
namespace textual_icons
216219
{
217220
// A note to a maintainer - preserve order when adding values to avoid duplicates
221+
static const textual_icon search{ u8"\uf002" };
218222
static const textual_icon file_movie{ u8"\uf008" };
219223
static const textual_icon times{ u8"\uf00d" };
224+
static const textual_icon cog{ u8"\uf013" };
225+
static const textual_icon rotate{ u8"\uf01e" };
220226
static const textual_icon download{ u8"\uf019" };
221227
static const textual_icon refresh{ u8"\uf021" };
222228
static const textual_icon lock{ u8"\uf023" };
223229
static const textual_icon camera{ u8"\uf030" };
224230
static const textual_icon video_camera{ u8"\uf03d" };
231+
static const textual_icon tint{ u8"\uf043" };
225232
static const textual_icon edit{ u8"\uf044" };
226233
static const textual_icon step_backward{ u8"\uf048" };
227234
static const textual_icon play{ u8"\uf04b" };
228235
static const textual_icon pause{ u8"\uf04c" };
229236
static const textual_icon stop{ u8"\uf04d" };
230237
static const textual_icon step_forward{ u8"\uf051" };
231238
static const textual_icon plus_circle{ u8"\uf055" };
239+
static const textual_icon times_circle{ u8"\uf057" };
232240
static const textual_icon question_mark{ u8"\uf059" };
233241
static const textual_icon info_circle{ u8"\uf05a" };
234-
static const textual_icon fix_up{ u8"\uf062" };
242+
static const textual_icon arrow_left{ u8"\uf060" };
243+
static const textual_icon arrow_right{ u8"\uf061" };
244+
static const textual_icon arrow_up{ u8"\uf062" };
245+
static const textual_icon arrow_down{ u8"\uf063" };
246+
static const textual_icon compress{ u8"\uf066" };
235247
static const textual_icon minus{ u8"\uf068" };
236248
static const textual_icon exclamation_triangle{ u8"\uf071" };
237249
static const textual_icon shopping_cart{ u8"\uf07a" };
250+
static const textual_icon folder_open{ u8"\uf07c" };
251+
static const textual_icon chevron_down{ u8"\uf078" };
238252
static const textual_icon bar_chart{ u8"\uf080" };
239253
static const textual_icon upload{ u8"\uf093" };
240254
static const textual_icon square_o{ u8"\uf096" };
241255
static const textual_icon unlock{ u8"\uf09c" };
242-
static const textual_icon floppy{ u8"\uf0c7" };
243-
static const textual_icon square{ u8"\uf0c8" };
256+
static const textual_icon up_down_left_right{ u8"\uf0b2" };
257+
static const textual_icon save{ u8"\uf0c7" };
258+
static const textual_icon check_square{ u8"\uf0c8" };
244259
static const textual_icon bars{ u8"\uf0c9" };
260+
static const textual_icon sort_asc{ u8"\uf0d0" };
245261
static const textual_icon caret_down{ u8"\uf0d7" };
246262
static const textual_icon repeat{ u8"\uf0e2" };
263+
static const textual_icon angle_double_up{ u8"\uf102" };
264+
static const textual_icon angle_double_down{ u8"\uf103" };
265+
static const textual_icon angle_right{ u8"\uf106" };
266+
static const textual_icon angle_left{ u8"\uf107" };
247267
static const textual_icon circle{ u8"\uf111" };
268+
static const textual_icon minus_square_o{ u8"\uf120" };
269+
static const textual_icon folder_open_o{ u8"\uf137" };
270+
static const textual_icon folder_o{ u8"\uf13a" };
248271
static const textual_icon check_square_o{ u8"\uf14a" };
272+
static const textual_icon cube{ u8"\uf1b2" };
249273
static const textual_icon cubes{ u8"\uf1b3" };
250274
static const textual_icon toggle_off{ u8"\uf204" };
251275
static const textual_icon toggle_on{ u8"\uf205" };
252276
static const textual_icon connectdevelop{ u8"\uf20e" };
253-
static const textual_icon usb_type{ u8"\uf287" };
277+
static const textual_icon industry{ u8"\uf275" };
278+
static const textual_icon usb{ u8"\uf287" };
254279
static const textual_icon braille{ u8"\uf2a1" };
255280
static const textual_icon window_maximize{ u8"\uf2d0" };
256281
static const textual_icon window_restore{ u8"\uf2d2" };
282+
static const textual_icon microchip{ u8"\uf2db" };
257283
static const textual_icon grid{ u8"\uf1cb" };
258-
static const textual_icon exit{ u8"\uf011" };
259-
static const textual_icon see_less{ u8"\uf070" };
260-
static const textual_icon dotdotdot{ u8"\uf141" };
261-
static const textual_icon link{ u8"\uf08e" };
262-
static const textual_icon throphy{ u8"\uF091" };
263-
static const textual_icon metadata{ u8"\uF0AE" };
284+
static const textual_icon power_off{ u8"\uf011" };
285+
static const textual_icon eye_slash{ u8"\uf070" };
286+
static const textual_icon ellipsis_h{ u8"\uf141" };
287+
static const textual_icon external_link{ u8"\uf08e" };
288+
static const textual_icon trophy{ u8"\uF091" };
289+
static const textual_icon list_ul{ u8"\uF0AE" };
264290
static const textual_icon check{ u8"\uF00C" };
265-
static const textual_icon mail{ u8"\uF01C" };
266-
static const textual_icon cube{ u8"\uf1b2" };
267-
static const textual_icon measure{ u8"\uf545" };
291+
static const textual_icon envelope{ u8"\uF01C" };
292+
static const textual_icon cube_dup{ u8"\uf1b2" };
293+
static const textual_icon hourglass{ u8"\uf251" };
294+
static const textual_icon plug_dup{ u8"\uf287" };
295+
static const textual_icon ruler{ u8"\uf545" };
296+
static const textual_icon palette{ u8"\uf576" };
297+
static const textual_icon adjust{ u8"\uf5aa" };
268298
static const textual_icon wifi{ u8"\uf1eb" };
269299
static const textual_icon grid_6{ u8"\uf58d" };
270-
static const textual_icon polygon{ u8"\uf5ee" };
300+
static const textual_icon draw_polygon{ u8"\uf5ee" };
271301
}
272302

273303
class viewer_model;

common/fw-update-helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ namespace rs2
453453

454454
ImGui::SetCursorScreenPos({ float(x + 10), float(y + 35) });
455455
ImGui::PushFont(win.get_large_font());
456-
std::string txt = rsutils::string::from() << textual_icons::throphy;
456+
std::string txt = rsutils::string::from() << textual_icons::trophy;
457457
ImGui::Text("%s", txt.c_str());
458458
ImGui::PopFont();
459459

common/notifications.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ namespace rs2
424424
ImGui::PushStyleColor(ImGuiCol_Button, transparent);
425425
ImGui::PushStyleColor(ImGuiCol_ButtonActive, transparent);
426426
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, transparent);
427-
string id = rsutils::string::from() << textual_icons::dotdotdot << "##" << index;
427+
string id = rsutils::string::from() << textual_icons::ellipsis_h << "##" << index;
428428
if (ImGui::Button(id.c_str()))
429429
{
430430
selected = shared_from_this();
@@ -871,7 +871,7 @@ namespace rs2
871871

872872
ImGui::SetCursorScreenPos({ float(x + 10), float(y + 35) });
873873
ImGui::PushFont(win.get_large_font());
874-
std::string txt = rsutils::string::from() << textual_icons::throphy;
874+
std::string txt = rsutils::string::from() << textual_icons::trophy;
875875
ImGui::Text("%s", txt.c_str());
876876
ImGui::PopFont();
877877

@@ -1151,7 +1151,7 @@ namespace rs2
11511151

11521152
ImGui::SetCursorScreenPos({ float(x + 10), float(y + 35) });
11531153
ImGui::PushFont(win.get_large_font());
1154-
std::string txt = rsutils::string::from() << textual_icons::throphy;
1154+
std::string txt = rsutils::string::from() << textual_icons::trophy;
11551155
ImGui::Text("%s", txt.c_str());
11561156
ImGui::PopFont();
11571157

common/on-chip-calib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ namespace rs2
17581758
ImGui::PushStyleColor(ImGuiCol_Text, update_state != RS2_CALIB_STATE_TARE_INPUT_ADVANCED ? light_grey : light_blue);
17591759
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, update_state != RS2_CALIB_STATE_TARE_INPUT_ADVANCED ? light_grey : light_blue);
17601760

1761-
if (ImGui::Button(u8"\uf0d7"))
1761+
if (ImGui::Button(textual_icons::caret_down))
17621762
{
17631763
if (update_state == RS2_CALIB_STATE_TARE_INPUT_ADVANCED)
17641764
update_state = RS2_CALIB_STATE_TARE_INPUT;
@@ -2596,7 +2596,7 @@ namespace rs2
25962596

25972597
ImGui::SetCursorScreenPos({ float(x + 10), float(y + 35) });
25982598
ImGui::PushFont(win.get_large_font());
2599-
std::string txt = rsutils::string::from() << textual_icons::throphy;
2599+
std::string txt = rsutils::string::from() << textual_icons::trophy;
26002600
ImGui::Text("%s", txt.c_str());
26012601
ImGui::PopFont();
26022602

0 commit comments

Comments
 (0)