Use wxBitmapBundle for AUI tab pages bitmaps
Take wxBitmapBundle instead of just wxBitmap in various public functions and select the bitmap appropriate for the current DPI scaling when we need to use it. Note that this removes wxAuiScaleBitmap() which used custom scaling logic that might be better than the generic approach used by wxBitmapBundle, and so could result in a temporary regression in the icons appearance in high DPI, but they will hopefully be replaced with SVG versions soon, so that this shouldn't matter.
This commit is contained in:
@@ -91,7 +91,7 @@ public:
|
||||
wxWindow* window; // page's associated window
|
||||
wxString caption; // caption displayed on the tab
|
||||
wxString tooltip; // tooltip displayed when hovering over tab title
|
||||
wxBitmap bitmap; // tab's bitmap
|
||||
wxBitmapBundle bitmap;// tab's bitmap
|
||||
wxRect rect; // tab's hit rectangle
|
||||
bool active; // true if the page is currently active
|
||||
bool hover; // true if mouse hovering over tab
|
||||
@@ -104,8 +104,8 @@ public:
|
||||
int id; // button's id
|
||||
int curState; // current state (normal, hover, pressed, etc.)
|
||||
int location; // buttons location (wxLEFT, wxRIGHT, or wxCENTER)
|
||||
wxBitmap bitmap; // button's hover bitmap
|
||||
wxBitmap disBitmap; // button's disabled bitmap
|
||||
wxBitmapBundle bitmap; // button's hover bitmap
|
||||
wxBitmapBundle disBitmap; // button's disabled bitmap
|
||||
wxRect rect; // button's hit rectangle
|
||||
};
|
||||
|
||||
@@ -156,8 +156,8 @@ public:
|
||||
void RemoveButton(int id);
|
||||
void AddButton(int id,
|
||||
int location,
|
||||
const wxBitmap& normalBitmap = wxNullBitmap,
|
||||
const wxBitmap& disabledBitmap = wxNullBitmap);
|
||||
const wxBitmapBundle& normalBitmap = wxBitmapBundle(),
|
||||
const wxBitmapBundle& disabledBitmap = wxBitmapBundle());
|
||||
|
||||
size_t GetTabOffset() const;
|
||||
void SetTabOffset(size_t offset);
|
||||
@@ -279,13 +279,13 @@ public:
|
||||
bool AddPage(wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
const wxBitmapBundle& bitmap = wxBitmapBundle());
|
||||
|
||||
bool InsertPage(size_t pageIdx,
|
||||
wxWindow* page,
|
||||
const wxString& caption,
|
||||
bool select = false,
|
||||
const wxBitmap& bitmap = wxNullBitmap);
|
||||
const wxBitmapBundle& bitmap = wxBitmapBundle());
|
||||
|
||||
bool DeletePage(size_t page) wxOVERRIDE;
|
||||
bool RemovePage(size_t page) wxOVERRIDE;
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
bool SetPageToolTip(size_t page, const wxString& text);
|
||||
wxString GetPageToolTip(size_t pageIdx) const;
|
||||
|
||||
bool SetPageBitmap(size_t page, const wxBitmap& bitmap);
|
||||
bool SetPageBitmap(size_t page, const wxBitmapBundle& bitmap);
|
||||
wxBitmap GetPageBitmap(size_t pageIdx) const;
|
||||
|
||||
int SetSelection(size_t newPage) wxOVERRIDE;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "wx/font.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/bmpbndl.h"
|
||||
|
||||
|
||||
class wxAuiNotebookPage;
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
wxDC& dc,
|
||||
wxWindow* wnd,
|
||||
const wxString& caption,
|
||||
const wxBitmap& bitmap,
|
||||
const wxBitmapBundle& bitmap,
|
||||
bool active,
|
||||
int closeButtonState,
|
||||
int* xExtent) = 0;
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
wxDC& dc,
|
||||
wxWindow* wnd,
|
||||
const wxString& caption,
|
||||
const wxBitmap& bitmap,
|
||||
const wxBitmapBundle& bitmap,
|
||||
bool active,
|
||||
int closeButtonState,
|
||||
int* xExtent) wxOVERRIDE;
|
||||
@@ -203,14 +203,14 @@ protected:
|
||||
wxPen m_borderPen;
|
||||
wxBrush m_baseColourBrush;
|
||||
wxColour m_activeColour;
|
||||
wxBitmap m_activeCloseBmp;
|
||||
wxBitmap m_disabledCloseBmp;
|
||||
wxBitmap m_activeLeftBmp;
|
||||
wxBitmap m_disabledLeftBmp;
|
||||
wxBitmap m_activeRightBmp;
|
||||
wxBitmap m_disabledRightBmp;
|
||||
wxBitmap m_activeWindowListBmp;
|
||||
wxBitmap m_disabledWindowListBmp;
|
||||
wxBitmapBundle m_activeCloseBmp;
|
||||
wxBitmapBundle m_disabledCloseBmp;
|
||||
wxBitmapBundle m_activeLeftBmp;
|
||||
wxBitmapBundle m_disabledLeftBmp;
|
||||
wxBitmapBundle m_activeRightBmp;
|
||||
wxBitmapBundle m_disabledRightBmp;
|
||||
wxBitmapBundle m_activeWindowListBmp;
|
||||
wxBitmapBundle m_disabledWindowListBmp;
|
||||
|
||||
int m_fixedTabWidth;
|
||||
int m_tabCtrlHeight;
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
wxDC& dc,
|
||||
wxWindow* wnd,
|
||||
const wxString& caption,
|
||||
const wxBitmap& bitmap,
|
||||
const wxBitmapBundle& bitmap,
|
||||
bool active,
|
||||
int closeButtonState,
|
||||
int* xExtent) wxOVERRIDE;
|
||||
@@ -303,14 +303,14 @@ protected:
|
||||
wxBrush m_normalBkBrush;
|
||||
wxBrush m_selectedBkBrush;
|
||||
wxBrush m_bkBrush;
|
||||
wxBitmap m_activeCloseBmp;
|
||||
wxBitmap m_disabledCloseBmp;
|
||||
wxBitmap m_activeLeftBmp;
|
||||
wxBitmap m_disabledLeftBmp;
|
||||
wxBitmap m_activeRightBmp;
|
||||
wxBitmap m_disabledRightBmp;
|
||||
wxBitmap m_activeWindowListBmp;
|
||||
wxBitmap m_disabledWindowListBmp;
|
||||
wxBitmapBundle m_activeCloseBmp;
|
||||
wxBitmapBundle m_disabledCloseBmp;
|
||||
wxBitmapBundle m_activeLeftBmp;
|
||||
wxBitmapBundle m_disabledLeftBmp;
|
||||
wxBitmapBundle m_activeRightBmp;
|
||||
wxBitmapBundle m_disabledRightBmp;
|
||||
wxBitmapBundle m_activeWindowListBmp;
|
||||
wxBitmapBundle m_disabledWindowListBmp;
|
||||
|
||||
int m_fixedTabWidth;
|
||||
unsigned int m_flags;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
int GetBorderWidth(wxWindow* wnd) wxOVERRIDE;
|
||||
int GetAdditionalBorderSpace(wxWindow* wnd) wxOVERRIDE;
|
||||
virtual wxSize GetTabSize(wxDC& dc, wxWindow* wnd, const wxString& caption,
|
||||
const wxBitmap& bitmap, bool active,
|
||||
const wxBitmapBundle& bitmap, bool active,
|
||||
int close_button_state, int* x_extent) wxOVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
wxDC& dc,
|
||||
wxWindow* wnd,
|
||||
const wxString& caption,
|
||||
const wxBitmap& bitmap,
|
||||
const wxBitmapBundle& bitmap,
|
||||
bool active,
|
||||
int closeButtonState,
|
||||
int* xExtent) wxOVERRIDE;
|
||||
|
||||
Reference in New Issue
Block a user