X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fabout.cpp;h=656a87140acb42c4c50c242958dca335cf92df94;hb=37600b4b217caa5e316984ec0b035c5e8f9698af;hp=539395fe1a55051472fd9141c4460ad4cf9efd22;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/about.cpp b/synfig-studio/trunk/src/gtkmm/about.cpp index 539395f..656a871 100644 --- a/synfig-studio/trunk/src/gtkmm/about.cpp +++ b/synfig-studio/trunk/src/gtkmm/about.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -158,25 +159,25 @@ public: /* === M E T H O D S ======================================================= */ About::About(): - Gtk::Window(Gtk::WINDOW_POPUP), + Gtk::Window(getenv("SYNFIG_DISABLE_POPUP_WINDOWS") ? Gtk::WINDOW_TOPLEVEL : Gtk::WINDOW_POPUP), can_self_destruct(true) { int image_w=300,image_h=350; std::string imagepath; #ifdef WIN32 - imagepath=App::get_base_path()+ETL_DIRECTORY_SEPERATOR+IMAGE_DIR; + imagepath=App::get_base_path()+ETL_DIRECTORY_SEPARATOR+IMAGE_DIR; #else imagepath=IMAGE_DIR; #endif char* synfig_root=getenv("SYNFIG_ROOT"); if(synfig_root) { imagepath=synfig_root; - imagepath+=ETL_DIRECTORY_SEPERATOR; + imagepath+=ETL_DIRECTORY_SEPARATOR; imagepath+="share/pixmaps"; } - imagepath+=ETL_DIRECTORY_SEPERATOR; + imagepath+=ETL_DIRECTORY_SEPARATOR; // Create the Logo @@ -193,6 +194,26 @@ About::About(): CopyrightLabel->set_padding(0,0); CopyrightLabel->set_justify(Gtk::JUSTIFY_CENTER); CopyrightLabel->set_line_wrap(false); + CopyrightLabel->modify_fg(Gtk::STATE_NORMAL,Gdk::Color("black")); + + /* Scale the text to fit */ + int width = 0; + int height = 0; + float size=11; + Glib::RefPtr l = CopyrightLabel->get_layout(); + Pango::FontDescription fd = Pango::FontDescription("Sans, 11"); + l->set_font_description(fd); + l->set_justify(Pango::ALIGN_CENTER); + fd.set_size(int(size*Pango::SCALE)); + l->set_font_description(fd); + l->get_pixel_size(width,height); + while( width >= image_w-6 ){ + size-=0.5; + fd.set_size((int)(size*Pango::SCALE)); + l->set_font_description(fd); + l->get_pixel_size(width,height); + } + CopyrightLabel->modify_font(fd); // Create the Version information label Gtk::Label *VersionLabel = manage(new class Gtk::Label("Version")); @@ -202,6 +223,7 @@ About::About(): VersionLabel->set_padding(0,0); VersionLabel->set_justify(Gtk::JUSTIFY_CENTER); VersionLabel->set_line_wrap(false); + VersionLabel->modify_fg(Gtk::STATE_NORMAL,Gdk::Color("black")); // Set the version label to contain the correct information string ver; @@ -219,6 +241,25 @@ About::About(): #endif VersionLabel->set_text(ver); + /* Scale the text to fit */ + width = 0; + height = 0; + size=11; + l = VersionLabel->get_layout(); + fd = Pango::FontDescription("Sans, 11"); + l->set_font_description(fd); + l->set_justify(Pango::ALIGN_CENTER); + fd.set_size(int(size*Pango::SCALE)); + l->set_font_description(fd); + l->get_pixel_size(width,height); + while( width >= image_w-6 ){ + size-=0.5; + fd.set_size((int)(size*Pango::SCALE)); + l->set_font_description(fd); + l->get_pixel_size(width,height); + } + VersionLabel->modify_font(fd); + // Create the image that will be used on the close button Gtk::Image *image2 = manage(new class Gtk::Image(Gtk::StockID("gtk-close"), Gtk::IconSize(4))); image2->set_alignment(0.5,0.5);