Changeset 2432


Ignore:
Timestamp:
Jul 19, 2007, 2:50:42 PM (15 years ago)
Author:
charles
Message:

wx: change from xpm to png to avoid jaggy edges in the icons

Location:
trunk/wx
Files:
6 added
6 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wx/xmission.cc

    r2431 r2432  
    88extern "C" {
    99  #include <libtransmission/transmission.h>
    10   #include "xpm/transmission.xpm"
    11   #include "xpm/fileopen.xpm"
    12   #include "xpm/gtk-remove.xpm"
    13   #include "xpm/gtk-properties.xpm"
    14   #include "xpm/exec.xpm"
    15   #include "xpm/stop.xpm"
    1610}
    1711
     
    8377    handle = tr_init( "wx" );
    8478
    85     MyFrame * frame = new MyFrame( _T("Transmission"),
     79    MyFrame * frame = new MyFrame( _T("Xmission"),
    8680                                   wxPoint(50,50),
    8781                                   wxSize(450,350));
     
    109103    myConfig( new wxConfig( _T("xmission") ) )
    110104{
    111     SetIcon( wxIcon( transmission_xpm ) );
     105    wxImage::AddHandler( new wxPNGHandler );
     106    wxImage transmission_logo ( _T("xpm/transmission.png"), wxBITMAP_TYPE_PNG );
     107    wxIcon ico;
     108    ico.CopyFromBitmap( wxBitmap( transmission_logo ) );
     109    SetIcon( ico );
     110    //SetIcon( wxImage( _T("xpm/transmission.png"), wxBITMAP_TYPE_PNG ) );
    112111
    113112    /**
     
    138137    m->Append( ID_SHOW_DEBUG_WINDOW, _T("Show &Debug Window") );
    139138    m->AppendSeparator();
    140     m->Append( wxID_ABOUT, _T("&About Transmission") );
     139    m->Append( wxID_ABOUT, _T("&About Xmission") );
    141140    menuBar->Append( m, _T("&Help") );
    142141
     
    147146    **/
    148147
     148    wxImage open_image( _T("xpm/fileopen.png"),        wxBITMAP_TYPE_PNG );
     149    wxImage exec_image( _T("xpm/exec.png"),            wxBITMAP_TYPE_PNG );
     150    wxImage stop_image( _T("xpm/stop.png"),            wxBITMAP_TYPE_PNG );
     151    wxImage drop_image( _T("xpm/gtk-remove.png"),      wxBITMAP_TYPE_PNG );
     152    wxImage info_image( _T("xpm/gtk-properties.png"),  wxBITMAP_TYPE_PNG );
     153
    149154    wxToolBar* toolbar = CreateToolBar( wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT | wxTB_TEXT );
    150155    toolbar->SetToolBitmapSize( wxSize( 16, 16 ) );
    151     toolbar->AddTool( wxID_OPEN, _T("Open"), wxIcon( fileopen_xpm ) );
    152     //toolbar->AddTool( wxID_OPEN, _T("Open"), wxIcon( gtk_open_xpm ) );
    153     //toolbar->AddTool( ID_START, _T("Start"), wxIcon( gtk_execute_xpm ) );
    154     toolbar->AddTool( ID_START, _T("Start"), wxIcon( exec_xpm ) );
    155     toolbar->AddTool( wxID_STOP, _T("Stop"), wxIcon( stop_xpm ) );
    156     toolbar->AddTool( wxID_REMOVE, _T("Remove"), wxIcon( gtk_remove_xpm ) );
     156    toolbar->AddTool( wxID_OPEN,   _T("Open"), open_image );
     157    toolbar->AddTool( ID_START,    _T("Start"), exec_image );
     158    toolbar->AddTool( wxID_STOP,   _T("Stop"), stop_image );
     159    toolbar->AddTool( wxID_REMOVE, _T("Remove"), drop_image );
    157160    toolbar->AddSeparator();
    158     toolbar->AddTool( ID_TORRENT_INFO, _("Torrent Info"), wxIcon( gtk_properties_xpm ) );
     161    toolbar->AddTool( ID_TORRENT_INFO, _("Torrent Info"), info_image );
    159162    toolbar->Realize();
    160163
     
    164167
    165168    CreateStatusBar();
    166     SetStatusText(_T("Welcome to Transmission!"));
     169    SetStatusText(_T("Welcome to Xmission!"));
    167170}
    168171
     
    174177void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
    175178{
     179    wxImage transmission_logo ( _T("xpm/transmission.png"), wxBITMAP_TYPE_PNG );
     180    wxIcon ico;
     181    ico.CopyFromBitmap( wxBitmap( transmission_logo ) );
     182
    176183    wxAboutDialogInfo info;
    177     info.SetName(_T("Transmission"));
     184    info.SetName(_T("Xmission"));
    178185    info.SetVersion(_T(LONG_VERSION_STRING));
    179186    info.SetCopyright(_T("Copyright 2005-2007 The Transmission Project"));
    180187    info.SetDescription(_T("A fast, lightweight bittorrent client"));
    181188    info.SetWebSite( _T( "http://transmission.m0k.org/" ) );
    182     info.SetIcon( wxIcon( transmission_xpm ) );
     189    info.SetIcon( ico );
    183190    info.AddDeveloper( "Josh Elsasser (Back-end; GTK+)" );
    184191    info.AddDeveloper ("Charles Kerr (Back-end, GTK+, wxWidgets)");
     
    187194    info.AddDeveloper( "Bryan Varner (BeOS)" );
    188195    wxAboutBox( info );
    189 
    190     //wxMessageBox(_T("Transmission " LONG_VERSION_STRING),
    191      //            _T("About Transmission"),
    192       //           wxOK|wxICON_INFORMATION, this);
    193196}
  • trunk/wx/xpm/Makefile.am

    r2431 r2432  
    11EXTRA_DIST = \
    2     exec.xpm \
    3     fileopen.xpm \
    4     gtk-properties.xpm \
    5     gtk-remove.xpm \
    6     stop.xpm \
    7     transmission.xpm
     2    exec.png \
     3    fileopen.png \
     4    gtk-properties.png \
     5    gtk-remove.png \
     6    stop.png \
     7    transmission.png
Note: See TracChangeset for help on using the changeset viewer.