forked from mia/Aegisub
Use 16x16 icons for dialogs rather than cropping the 24x24 icons to 16x16
Originally committed to SVN as r6650.
This commit is contained in:
parent
a679d91304
commit
fe36760872
19 changed files with 29 additions and 53 deletions
|
@ -67,7 +67,7 @@ DialogAttachments::DialogAttachments(wxWindow *parent, AssFile *ass)
|
||||||
: wxDialog(parent,-1,_("Attachment List"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE)
|
: wxDialog(parent,-1,_("Attachment List"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE)
|
||||||
, ass(ass)
|
, ass(ass)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(attach_button_24)));
|
SetIcon(GETICON(attach_button_16));
|
||||||
|
|
||||||
listView = new wxListView(this,ATTACHMENT_LIST,wxDefaultPosition,wxSize(500,200));
|
listView = new wxListView(this,ATTACHMENT_LIST,wxDefaultPosition,wxSize(500,200));
|
||||||
UpdateList();
|
UpdateList();
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "subtitle_format.h"
|
#include "subtitle_format.h"
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
using std::tr1::placeholders::_1;
|
using std::tr1::placeholders::_1;
|
||||||
|
|
||||||
|
@ -68,7 +67,7 @@ DialogAutomation::DialogAutomation(agi::Context *c)
|
||||||
, global_manager(wxGetApp().global_scripts)
|
, global_manager(wxGetApp().global_scripts)
|
||||||
, global_scripts_changed(global_manager->AddScriptChangeListener(&DialogAutomation::RebuildList, this))
|
, global_scripts_changed(global_manager->AddScriptChangeListener(&DialogAutomation::RebuildList, this))
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(automation_toolbutton_24)));
|
SetIcon(GETICON(automation_toolbutton_16));
|
||||||
|
|
||||||
// create main controls
|
// create main controls
|
||||||
list = new wxListView(this, -1, wxDefaultPosition, wxSize(600, 175), wxLC_REPORT|wxLC_SINGLE_SEL);
|
list = new wxListView(this, -1, wxDefaultPosition, wxSize(600, 175), wxLC_REPORT|wxLC_SINGLE_SEL);
|
||||||
|
|
|
@ -184,7 +184,7 @@ DialogFontsCollector::DialogFontsCollector(agi::Context *c)
|
||||||
: wxDialog(c->parent, -1, _("Fonts Collector"))
|
: wxDialog(c->parent, -1, _("Fonts Collector"))
|
||||||
, subs(c->ass)
|
, subs(c->ass)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(font_collector_button_24)));
|
SetIcon(GETICON(font_collector_button_16));
|
||||||
|
|
||||||
wxString modes[] = {
|
wxString modes[] = {
|
||||||
_("Check fonts for availability"),
|
_("Check fonts for availability"),
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#include "ass_time.h"
|
#include "ass_time.h"
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "timeedit_ctrl.h"
|
#include "timeedit_ctrl.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "validators.h"
|
#include "validators.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ DialogJumpTo::DialogJumpTo(agi::Context *c)
|
||||||
, c(c)
|
, c(c)
|
||||||
, jumpframe(c->videoController->GetFrameN())
|
, jumpframe(c->videoController->GetFrameN())
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(jumpto_button_24)));
|
SetIcon(GETICON(jumpto_button_16));
|
||||||
|
|
||||||
// Set initial values
|
// Set initial values
|
||||||
wxString maxLength = wxString::Format("%i",c->videoController->GetLength() - 1);
|
wxString maxLength = wxString::Format("%i",c->videoController->GetLength() - 1);
|
||||||
|
|
|
@ -633,7 +633,7 @@ bool KaraokeLineMatchDisplay::UndoMatch()
|
||||||
DialogKanjiTimer::DialogKanjiTimer(agi::Context *c)
|
DialogKanjiTimer::DialogKanjiTimer(agi::Context *c)
|
||||||
: wxDialog(c->parent,-1,_("Kanji timing"),wxDefaultPosition)
|
: wxDialog(c->parent,-1,_("Kanji timing"),wxDefaultPosition)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(kara_timing_copier_24)));
|
SetIcon(GETICON(kara_timing_copier_16));
|
||||||
|
|
||||||
subs = c->ass;
|
subs = c->ass;
|
||||||
currentSourceLine = subs->Line.begin();
|
currentSourceLine = subs->Line.begin();
|
||||||
|
|
|
@ -51,7 +51,6 @@
|
||||||
#include "help_button.h"
|
#include "help_button.h"
|
||||||
#include "include/aegisub/context.h"
|
#include "include/aegisub/context.h"
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "validators.h"
|
#include "validators.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ DialogProperties::DialogProperties(agi::Context *c)
|
||||||
: wxDialog(c->parent, -1, _("Script Properties"))
|
: wxDialog(c->parent, -1, _("Script Properties"))
|
||||||
, c(c)
|
, c(c)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(properties_toolbutton_24)));
|
SetIcon(GETICON(properties_toolbutton_16));
|
||||||
|
|
||||||
// Script details crap
|
// Script details crap
|
||||||
wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Script"));
|
wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Script"));
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
#include "include/aegisub/context.h"
|
#include "include/aegisub/context.h"
|
||||||
#include "help_button.h"
|
#include "help_button.h"
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -56,7 +55,7 @@ DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings)
|
||||||
: wxDialog(c->parent, -1, _("Resample Resolution"))
|
: wxDialog(c->parent, -1, _("Resample Resolution"))
|
||||||
, c(c)
|
, c(c)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(resample_toolbutton_24)));
|
SetIcon(GETICON(resample_toolbutton_16));
|
||||||
|
|
||||||
memset(&settings, 0, sizeof(settings));
|
memset(&settings, 0, sizeof(settings));
|
||||||
c->ass->GetResolution(settings.script_x, settings.script_y);
|
c->ass->GetResolution(settings.script_x, settings.script_y);
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "standard_paths.h"
|
#include "standard_paths.h"
|
||||||
#include "timeedit_ctrl.h"
|
#include "timeedit_ctrl.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
||||||
static wxString get_history_string(json::Object &obj) {
|
static wxString get_history_string(json::Object &obj) {
|
||||||
|
@ -107,7 +106,7 @@ DialogShiftTimes::DialogShiftTimes(agi::Context *context)
|
||||||
, history(new json::Array)
|
, history(new json::Array)
|
||||||
, timecodes_loaded_slot(context->videoController->AddTimecodesListener(&DialogShiftTimes::OnTimecodesLoaded, this))
|
, timecodes_loaded_slot(context->videoController->AddTimecodesListener(&DialogShiftTimes::OnTimecodesLoaded, this))
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(shift_times_toolbutton_24)));
|
SetIcon(GETICON(shift_times_toolbutton_16));
|
||||||
|
|
||||||
// Create controls
|
// Create controls
|
||||||
shift_by_time = new wxRadioButton(this, -1, _("&Time: "), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
|
shift_by_time = new wxRadioButton(this, -1, _("&Time: "), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
|
||||||
|
|
|
@ -60,7 +60,7 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
|
||||||
, active_line(0)
|
, active_line(0)
|
||||||
, has_looped(false)
|
, has_looped(false)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(spellcheck_toolbutton_24)));
|
SetIcon(GETICON(spellcheck_toolbutton_16));
|
||||||
|
|
||||||
wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
|
||||||
|
|
||||||
work.reset(new AssStyle(*style));
|
work.reset(new AssStyle(*style));
|
||||||
|
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(style_toolbutton_24)));
|
SetIcon(GETICON(style_toolbutton_16));
|
||||||
|
|
||||||
// Prepare control values
|
// Prepare control values
|
||||||
wxString EncodingValue = AegiIntegerToString(style->encoding);
|
wxString EncodingValue = AegiIntegerToString(style->encoding);
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
#include "persist_location.h"
|
#include "persist_location.h"
|
||||||
#include "selection_controller.h"
|
#include "selection_controller.h"
|
||||||
#include "standard_paths.h"
|
#include "standard_paths.h"
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
using std::tr1::placeholders::_1;
|
using std::tr1::placeholders::_1;
|
||||||
|
|
||||||
|
@ -168,7 +167,7 @@ DialogStyleManager::DialogStyleManager(agi::Context *context)
|
||||||
, commit_connection(c->ass->AddCommitListener(&DialogStyleManager::LoadCurrentStyles, this))
|
, commit_connection(c->ass->AddCommitListener(&DialogStyleManager::LoadCurrentStyles, this))
|
||||||
{
|
{
|
||||||
using std::tr1::bind;
|
using std::tr1::bind;
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(style_toolbutton_24)));
|
SetIcon(GETICON(style_toolbutton_16));
|
||||||
|
|
||||||
// Catalog
|
// Catalog
|
||||||
wxSizer *CatalogBox = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Catalog of available storages"));
|
wxSizer *CatalogBox = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Catalog of available storages"));
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "help_button.h"
|
#include "help_button.h"
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "persist_location.h"
|
#include "persist_location.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
||||||
#ifndef AGI_PRE
|
#ifndef AGI_PRE
|
||||||
|
@ -60,7 +59,7 @@ DialogStyling::DialogStyling(agi::Context *context)
|
||||||
, c(context)
|
, c(context)
|
||||||
, active_line(0)
|
, active_line(0)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(styling_toolbutton_24)));
|
SetIcon(GETICON(styling_toolbutton_16));
|
||||||
|
|
||||||
wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
wxSizer *bottom_sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *bottom_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
|
@ -107,7 +107,7 @@ DialogTimingProcessor::DialogTimingProcessor(agi::Context *c)
|
||||||
{
|
{
|
||||||
using std::tr1::bind;
|
using std::tr1::bind;
|
||||||
|
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(timing_processor_toolbutton_24)));
|
SetIcon(GETICON(timing_processor_toolbutton_16));
|
||||||
|
|
||||||
// Read options
|
// Read options
|
||||||
leadIn = OPT_GET("Audio/Lead/IN")->GetInt();
|
leadIn = OPT_GET("Audio/Lead/IN")->GetInt();
|
||||||
|
|
|
@ -73,7 +73,7 @@ DialogTranslation::DialogTranslation(agi::Context *c)
|
||||||
, line_number(count_if(c->ass->Line.begin(), find(c->ass->Line.begin(), c->ass->Line.end(), active_line), cast<AssDialogue*>()) + 1)
|
, line_number(count_if(c->ass->Line.begin(), find(c->ass->Line.begin(), c->ass->Line.end(), active_line), cast<AssDialogue*>()) + 1)
|
||||||
, switching_lines(false)
|
, switching_lines(false)
|
||||||
{
|
{
|
||||||
SetIcon(BitmapToIcon(GETIMAGE(translation_toolbutton_16)));
|
SetIcon(GETICON(translation_toolbutton_16));
|
||||||
|
|
||||||
wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,17 @@
|
||||||
|
|
||||||
wxBitmap libresrc_getimage(const unsigned char *buff, size_t size) {
|
wxBitmap libresrc_getimage(const unsigned char *buff, size_t size) {
|
||||||
wxMemoryInputStream mem(buff, size);
|
wxMemoryInputStream mem(buff, size);
|
||||||
wxImage image(mem);
|
return wxBitmap(wxImage(mem));
|
||||||
return wxBitmap(image);
|
}
|
||||||
|
|
||||||
|
wxIcon libresrc_geticon(const unsigned char *buff, size_t size) {
|
||||||
|
wxMemoryInputStream mem(buff, size);
|
||||||
|
wxIcon icon;
|
||||||
|
icon.CopyFromBitmap(wxBitmap(wxImage(mem)));
|
||||||
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string libresrc_getconfig(const unsigned char *config, size_t size) {
|
const std::string libresrc_getconfig(const unsigned char *config, size_t size) {
|
||||||
std::string str((char*)config, size);
|
std::string str((char*)config, size);
|
||||||
return str.c_str();
|
return str.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <wx/mstream.h>
|
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
|
#include <wx/icon.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
|
#include <wx/mstream.h>
|
||||||
|
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "default_config.h"
|
#include "default_config.h"
|
||||||
|
|
||||||
wxBitmap libresrc_getimage(const unsigned char *image, size_t size);
|
wxBitmap libresrc_getimage(const unsigned char *image, size_t size);
|
||||||
|
wxIcon libresrc_geticon(const unsigned char *image, size_t size);
|
||||||
#define GETIMAGE(a) libresrc_getimage(a, sizeof(a))
|
#define GETIMAGE(a) libresrc_getimage(a, sizeof(a))
|
||||||
|
#define GETICON(a) libresrc_geticon(a, sizeof(a))
|
||||||
|
|
||||||
const std::string libresrc_getconfig(const unsigned char *config, size_t size);
|
const std::string libresrc_getconfig(const unsigned char *config, size_t size);
|
||||||
#define GET_DEFAULT_CONFIG(a) libresrc_getconfig(a, sizeof(a))
|
#define GET_DEFAULT_CONFIG(a) libresrc_getconfig(a, sizeof(a))
|
||||||
|
|
|
@ -658,7 +658,7 @@ static void PageChanged(wxBookCtrlEvent& evt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Preferences::Preferences(wxWindow *parent): wxDialog(parent, -1, _("Preferences"), wxDefaultPosition, wxSize(-1, 500)) {
|
Preferences::Preferences(wxWindow *parent): wxDialog(parent, -1, _("Preferences"), wxDefaultPosition, wxSize(-1, 500)) {
|
||||||
// SetIcon(BitmapToIcon(GETIMAGE(options_button_24)));
|
// SetIcon(GETICON(options_button_16));
|
||||||
|
|
||||||
book = new wxTreebook(this, -1, wxDefaultPosition, wxDefaultSize);
|
book = new wxTreebook(this, -1, wxDefaultPosition, wxDefaultSize);
|
||||||
new General(book, this);
|
new General(book, this);
|
||||||
|
|
|
@ -271,27 +271,6 @@ int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start,int end)
|
||||||
return (major + minor)*sign;
|
return (major + minor)*sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIcon BitmapToIcon(wxBitmap const& iconBmp) {
|
|
||||||
// Create the icon and background bmp
|
|
||||||
wxIcon ico;
|
|
||||||
wxBitmap bmp(16,16);
|
|
||||||
|
|
||||||
// Blit bitmap into 16x16 one (don't remove brackets)
|
|
||||||
{
|
|
||||||
wxMemoryDC dc;
|
|
||||||
dc.SelectObject(bmp);
|
|
||||||
dc.SetBackground(wxColour(192,192,192));
|
|
||||||
dc.Clear();
|
|
||||||
dc.DrawBitmap(iconBmp,0,0,false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create mask and convert to icon
|
|
||||||
wxMask *mask = new wxMask(bmp,wxColour(192,192,192));
|
|
||||||
bmp.SetMask(mask);
|
|
||||||
ico.CopyFromBitmap(bmp);
|
|
||||||
return ico;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RestartAegisub() {
|
void RestartAegisub() {
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
wxStandardPaths stand;
|
wxStandardPaths stand;
|
||||||
|
|
|
@ -88,11 +88,6 @@ bool StringEmptyOrWhitespace(const wxString &str);
|
||||||
int AegiStringToInt(const wxString &str,int start=0,int end=-1);
|
int AegiStringToInt(const wxString &str,int start=0,int end=-1);
|
||||||
int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start=0,int end=-1);
|
int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start=0,int end=-1);
|
||||||
|
|
||||||
/// @brief Convert a wxBitmap to wxIcon
|
|
||||||
///
|
|
||||||
/// This is needed because wxIcon has to be 16x16 to work properly on win32
|
|
||||||
wxIcon BitmapToIcon(wxBitmap const& bmp);
|
|
||||||
|
|
||||||
/// @brief Launch a new copy of Aegisub.
|
/// @brief Launch a new copy of Aegisub.
|
||||||
///
|
///
|
||||||
/// Contrary to what the name suggests, this does not close the currently
|
/// Contrary to what the name suggests, this does not close the currently
|
||||||
|
|
Loading…
Reference in a new issue