mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-07-01 09:47:39 +00:00
Improve ui icons
This commit is contained in:
parent
9bc06b941a
commit
8b37da88aa
19 changed files with 536 additions and 2742 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,5 @@
|
|||
#include "binres.hpp"
|
||||
#include <unordered_map>
|
||||
|
||||
// Embedded binary data (e.g: PGNs icons):
|
||||
#include "binary_data.hpp"
|
||||
|
@ -10,23 +11,21 @@ wxBitmap LoadPNG(std::string icon, wxSize size) {
|
|||
}
|
||||
|
||||
wxBitmap LoadPNG(std::string icon) {
|
||||
if (icon == "swap") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(swap));
|
||||
} else if (icon == "zoomin") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(zoomin));
|
||||
} else if (icon == "zoomout") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(zoomout));
|
||||
} else if (icon == "cburnett") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(cburnett));
|
||||
} else if (icon == "chesscom_8bits") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(chesscom_8bits));
|
||||
} else if (icon == "hide") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(hide));
|
||||
} else if (icon == "mat") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(mat));
|
||||
} else if (icon == "ochess") {
|
||||
return (wxBITMAP_PNG_FROM_DATA(ochess));
|
||||
std::unordered_map<std::string, wxBitmap> u = {
|
||||
{"ui_zoom_in", wxBITMAP_PNG_FROM_DATA(ui_zoom_in)},
|
||||
{"ui_zoom_out", wxBITMAP_PNG_FROM_DATA(ui_zoom_out)},
|
||||
{"ui_coins_swap", wxBITMAP_PNG_FROM_DATA(ui_coins_swap)},
|
||||
{"ui_eye_close", wxBITMAP_PNG_FROM_DATA(ui_eye_close)},
|
||||
{"mat", wxBITMAP_PNG_FROM_DATA(mat)},
|
||||
{"ochess", wxBITMAP_PNG_FROM_DATA(ochess)},
|
||||
{"cburnett", wxBITMAP_PNG_FROM_DATA(cburnett)},
|
||||
{"chesscom_8bits", wxBITMAP_PNG_FROM_DATA(chesscom_8bits)}
|
||||
};
|
||||
// Return png if exists
|
||||
if(u.count(icon)){
|
||||
return u[icon];
|
||||
}
|
||||
// Otherwise null bitmap
|
||||
return (wxNullBitmap);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ wxBitmap LoadPNG(std::string icon, wxSize size);
|
|||
* @brief Load an icon from embedded binary resources
|
||||
*
|
||||
* @param icon
|
||||
* @return wxBitmap
|
||||
* @return wxBitmap the image or wxNullBitmap if not found
|
||||
*/
|
||||
wxBitmap LoadPNG(std::string icon);
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game)
|
|||
main_sizer->Insert(1, board_canvas, 1, wxEXPAND);
|
||||
|
||||
// Configure buttons
|
||||
swap_button->SetBitmapLabel(LoadPNG("swap"));
|
||||
zoomin_button->SetBitmapLabel(LoadPNG("zoomin"));
|
||||
zoomout_button->SetBitmapLabel(LoadPNG("zoomout"));
|
||||
swap_button->SetBitmapLabel(LoadPNG("ui_coins_swap"));
|
||||
zoomin_button->SetBitmapLabel(LoadPNG("ui_zoom_in"));
|
||||
zoomout_button->SetBitmapLabel(LoadPNG("ui_zoom_out"));
|
||||
|
||||
// Configure FEN field
|
||||
fen_text_field->SetFont(wxFont(*wxNORMAL_FONT).Bold().Larger());
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
EditorCanvas::EditorCanvas(wxFrame *parent, std::shared_ptr<Game> game)
|
||||
: wxPanel(parent), game(game) {
|
||||
hide_icon = LoadPNG("hide", wxSize(CGEditor::status.MoveIconWidth,
|
||||
hide_icon = LoadPNG("ui_eye_close", wxSize(CGEditor::status.MoveIconWidth,
|
||||
CGEditor::status.MoveIconWidth));
|
||||
t.ResizePieces(CGEditor::status.MoveIconWidth);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue