mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-31 09:33:06 +00:00
Merge pull request #2324 from endrift/about-dialog-osx
Attempt to beautify About dialog on OS X.
This commit is contained in:
commit
65457628d7
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
Data/Sys/Resources/dolphin_logo@2x.png
Normal file
BIN
Data/Sys/Resources/dolphin_logo@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.8 KiB |
@ -17,19 +17,47 @@
|
|||||||
#include <wx/windowid.h>
|
#include <wx/windowid.h>
|
||||||
#include <wx/generic/statbmpg.h>
|
#include <wx/generic/statbmpg.h>
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#import <AppKit/AppKit.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "DolphinWX/AboutDolphin.h"
|
#include "DolphinWX/AboutDolphin.h"
|
||||||
#include "DolphinWX/resources/dolphin_logo.cpp"
|
#include "DolphinWX/resources/dolphin_logo.cpp"
|
||||||
|
|
||||||
|
static void BanishBackground(wxTextCtrl* ctrl)
|
||||||
|
{
|
||||||
|
#ifdef __APPLE__
|
||||||
|
NSTextField* tf = (NSTextField*)ctrl->GetHandle();
|
||||||
|
tf.drawsBackground = NO;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
|
AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
|
||||||
const wxString &title, const wxPoint &position,
|
const wxString &title, const wxPoint &position,
|
||||||
const wxSize& size, long style)
|
const wxSize& size, long style)
|
||||||
: wxDialog(parent, id, title, position, size, style)
|
: wxDialog(parent, id, title, position, size, style)
|
||||||
{
|
{
|
||||||
wxMemoryInputStream istream(dolphin_logo_png, sizeof dolphin_logo_png);
|
const unsigned char* dolphin_logo_bin = dolphin_logo_png;
|
||||||
|
size_t dolphin_logo_size = sizeof dolphin_logo_png;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
double scaleFactor = 1.0;
|
||||||
|
if (GetContentScaleFactor() >= 2)
|
||||||
|
{
|
||||||
|
dolphin_logo_bin = dolphin_logo_2x_png;
|
||||||
|
dolphin_logo_size = sizeof dolphin_logo_2x_png;
|
||||||
|
scaleFactor = 2.0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
wxMemoryInputStream istream(dolphin_logo_bin, dolphin_logo_size);
|
||||||
wxImage iDolphinLogo(istream, wxBITMAP_TYPE_PNG);
|
wxImage iDolphinLogo(istream, wxBITMAP_TYPE_PNG);
|
||||||
|
#ifdef __APPLE__
|
||||||
|
wxGenericStaticBitmap* const sbDolphinLogo = new wxGenericStaticBitmap(this, wxID_ANY,
|
||||||
|
wxBitmap(iDolphinLogo, -1, scaleFactor));
|
||||||
|
#else
|
||||||
wxGenericStaticBitmap* const sbDolphinLogo = new wxGenericStaticBitmap(this, wxID_ANY,
|
wxGenericStaticBitmap* const sbDolphinLogo = new wxGenericStaticBitmap(this, wxID_ANY,
|
||||||
wxBitmap(iDolphinLogo));
|
wxBitmap(iDolphinLogo));
|
||||||
|
#endif
|
||||||
|
|
||||||
const wxString DolphinText = _("Dolphin");
|
const wxString DolphinText = _("Dolphin");
|
||||||
const wxString RevisionText = scm_desc_str;
|
const wxString RevisionText = scm_desc_str;
|
||||||
@ -47,9 +75,11 @@ AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
|
|||||||
const wxString SupportText = _("Support");
|
const wxString SupportText = _("Support");
|
||||||
|
|
||||||
wxStaticText* const Dolphin = new wxStaticText(this, wxID_ANY, DolphinText);
|
wxStaticText* const Dolphin = new wxStaticText(this, wxID_ANY, DolphinText);
|
||||||
wxTextCtrl* const Revision = new wxTextCtrl(this, wxID_ANY, RevisionText, wxDefaultPosition, wxDefaultSize);
|
wxTextCtrl* const Revision = new wxTextCtrl(this, wxID_ANY, RevisionText, wxDefaultPosition, wxDefaultSize, wxNO_BORDER | wxTE_NO_VSCROLL);
|
||||||
|
BanishBackground(Revision);
|
||||||
wxStaticText* const Copyright = new wxStaticText(this, wxID_ANY, CopyrightText);
|
wxStaticText* const Copyright = new wxStaticText(this, wxID_ANY, CopyrightText);
|
||||||
wxTextCtrl* const Branch = new wxTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxSize(300, 50), wxTE_MULTILINE | wxNO_BORDER | wxTE_NO_VSCROLL);
|
wxTextCtrl* const Branch = new wxTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxSize(300, 50), wxNO_BORDER | wxTE_NO_VSCROLL);
|
||||||
|
BanishBackground(Branch);
|
||||||
wxStaticText* const Message = new wxStaticText(this, wxID_ANY, Text);
|
wxStaticText* const Message = new wxStaticText(this, wxID_ANY, Text);
|
||||||
wxStaticText* const Update = new wxStaticText(this, wxID_ANY, CheckUpdateText);
|
wxStaticText* const Update = new wxStaticText(this, wxID_ANY, CheckUpdateText);
|
||||||
wxStaticText* const FirstSpacer = new wxStaticText(this, wxID_ANY, wxString(" | "));
|
wxStaticText* const FirstSpacer = new wxStaticText(this, wxID_ANY, wxString(" | "));
|
||||||
@ -106,8 +136,15 @@ AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
|
|||||||
sInfo->Add(Message);
|
sInfo->Add(Message);
|
||||||
sInfo->Add(sLinks);
|
sInfo->Add(sLinks);
|
||||||
|
|
||||||
|
wxBoxSizer* const sLogo = new wxBoxSizer(wxVERTICAL);
|
||||||
|
sLogo->AddSpacer(75);
|
||||||
|
sLogo->Add(sbDolphinLogo);
|
||||||
|
sLogo->AddSpacer(40);
|
||||||
|
|
||||||
wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sMainHor->Add(sbDolphinLogo);
|
sMainHor->AddSpacer(30);
|
||||||
|
sMainHor->Add(sLogo);
|
||||||
|
sMainHor->AddSpacer(30);
|
||||||
sMainHor->Add(sInfo);
|
sMainHor->Add(sInfo);
|
||||||
sMainHor->AddSpacer(30);
|
sMainHor->AddSpacer(30);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user