diff --git a/Makefile b/Makefile index 534d2ce..05dc71b 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ LOCAL_INCLUDE_PATHS = Src/Source \ # Specify the level of optimization that you want. Specify either NONE (O0), # SOME (O1), FULL (O2), or leave blank (for the default optimization level). -OPTIMIZE := NONE +OPTIMIZE := FULL # Specify the codes for languages you are going to support in this # application. The default "en" one must be provided too. "make catkeys" diff --git a/Src/Headers/AboutWindow.h b/Src/Headers/AboutWindow.h index 44f971e..3e7784b 100644 --- a/Src/Headers/AboutWindow.h +++ b/Src/Headers/AboutWindow.h @@ -8,6 +8,7 @@ #define ABOUT_WINDOW_H #include +#include #include #include #include @@ -17,7 +18,7 @@ #include "GradientView.h" const uint32 UPDATE_COLORS = 'updt'; -const int32 UPDATE_TIME = 100; +const int32 UPDATE_TIME = 2000; class AboutView : public BView { public: @@ -44,7 +45,7 @@ class AboutWindow : public BWindow { private: AboutView* m_about; BMessenger* m_msgr; - + BMessageRunner* m_run; BButton *m_homePage, *m_donate, *m_beBits, *m_quit; GradientView* m_gradient; diff --git a/Src/Headers/Constants.h b/Src/Headers/Constants.h index 1d5b5f0..050250a 100644 --- a/Src/Headers/Constants.h +++ b/Src/Headers/Constants.h @@ -206,8 +206,7 @@ namespace AboutMessages const uint32 K_ABOUT_WINDOW_QUIT = 'abwq', K_ABOUT_WINDOW_LAUNCH = 'abwg', K_GOTO_BETEX_HOMEPAGE = 'gtbh', - K_GOTO_BETEX_DONATEPAGE = 'gtbd', - K_GOTO_BETEX_BEBITSPAGE = 'gbbb' + K_GOTO_BETEX_DONATEPAGE = 'gtbd' ; }; diff --git a/Src/Headers/MainWindow.h b/Src/Headers/MainWindow.h index 44d9fcf..1b0b769 100644 --- a/Src/Headers/MainWindow.h +++ b/Src/Headers/MainWindow.h @@ -6,8 +6,6 @@ #include #include #include -#include -#include #include #include #include @@ -17,9 +15,9 @@ using std::vector; #include "AboutWindow.h" -#include "BubbleHelper.h" #include "ColorWindow.h" #include "DimensionWindow.h" +#include "DocView.h" #include "GoToLineWindow.h" #include "MainTBar.h" #include "PrefsWindow.h" @@ -29,8 +27,6 @@ using std::vector; #include "SplitPane.h" #include "StatusBar.h" #include "TexBar.h" -#include "TexView.h" -#include "iconheaders/ConverterIcons.h" class MainWindow : public BWindow { public: diff --git a/Src/Headers/Prefs.h b/Src/Headers/Prefs.h index 88d3c81..c609c9c 100644 --- a/Src/Headers/Prefs.h +++ b/Src/Headers/Prefs.h @@ -3,7 +3,6 @@ #include #include -#include #include #include diff --git a/Src/Headers/PrefsWindow.h b/Src/Headers/PrefsWindow.h index 979c522..ff615e2 100644 --- a/Src/Headers/PrefsWindow.h +++ b/Src/Headers/PrefsWindow.h @@ -7,10 +7,6 @@ #include #include #include -#include -#include -#include -#include #include "ColorButton.h" #include "Prefs.h" diff --git a/Src/Headers/ProjectItem.h b/Src/Headers/ProjectItem.h index 7870bb0..c05d569 100644 --- a/Src/Headers/ProjectItem.h +++ b/Src/Headers/ProjectItem.h @@ -10,7 +10,6 @@ #include #include #include -#include #include diff --git a/Src/Headers/SearchWindow.h b/Src/Headers/SearchWindow.h index 744390d..1af342a 100644 --- a/Src/Headers/SearchWindow.h +++ b/Src/Headers/SearchWindow.h @@ -6,8 +6,6 @@ #include #include #include -#include -#include #include "TexView.h" class ParentView; diff --git a/Src/Headers/TexView.h b/Src/Headers/TexView.h index b1d35f0..ae49be7 100644 --- a/Src/Headers/TexView.h +++ b/Src/Headers/TexView.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff --git a/Src/Source/AboutWindow.cpp b/Src/Source/AboutWindow.cpp index 9f7e7df..f7527a0 100644 --- a/Src/Source/AboutWindow.cpp +++ b/Src/Source/AboutWindow.cpp @@ -38,11 +38,11 @@ AboutView::Draw(BRect updateRect) DrawBitmap(m_logo); MovePenTo((updateRect.Width() - m_logo->Bounds().Width()) / 4, 0); - MovePenBy(0, 100); + MovePenBy(0, 90); BPoint p = PenLocation(); BString about_line; - // about_line << "BeTeX " << BETEX_VERSION << " by Brent Miszalski"; + about_line << "BeTeX " /*<< BETEX_VERSION <<*/ " by Brent Miszalski"; DrawString(about_line.String()); //.\nThanks to:\n\tEli Dayan\n\tMichael Pfeiffer\n"); MovePenTo(p); MovePenBy(0, 20); @@ -51,6 +51,9 @@ AboutView::Draw(BRect updateRect) MovePenTo(p); MovePenBy(font.StringWidth("Thanks To: "), 20); DrawString("Michael Pfeiffer"); + MovePenTo(p); + MovePenBy(0, 40); + DrawString("Adapted to Haiku by Sylvain Kerjean"); updateRect = Bounds(); SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_2_TINT)); @@ -94,51 +97,46 @@ AboutWindow::AboutWindow(BRect frame, BMessenger* messenger) AddChild(m_gradient = new GradientView(specRect, m_top, m_bottom)); BRect aboutRect = Bounds(); - aboutRect.InsetBy(80, 60); + aboutRect.InsetBy(70, 60); m_about = new AboutView(aboutRect); m_about->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); m_gradient->AddChild(m_about); int bwidth = 50; int bheight = 30; - int bpad = 10; - BRect btnRect(frame.right - (2 * bpad) - bwidth, frame.bottom - (2 * bpad) - bheight, - frame.right - (2 * bpad), frame.bottom - (2 * bpad)); + int bpad = (aboutRect.Width() - (60 + 120 + 50)) / 2; + BRect btnRect( + aboutRect.right - bwidth, frame.bottom - 15 - bheight, aboutRect.right, frame.bottom - 15); m_quit = new BButton(btnRect, "quitbtn", "OK", new BMessage(AboutMessages::K_ABOUT_WINDOW_QUIT)); m_quit->MakeDefault(true); - m_gradient->AddChild(m_quit); - - bwidth = 100; - btnRect = BRect(frame.right - (2 * bpad) - bwidth, frame.bottom - (2 * bpad) - bheight, - frame.right - (2 * bpad), frame.bottom - (2 * bpad)); - btnRect.OffsetBy(-(50 + (2 * bpad)), 0); + bwidth = 120; + btnRect = BRect( + aboutRect.right - bwidth, frame.bottom - 15 - bheight, aboutRect.right, frame.bottom - 15); + btnRect.OffsetBy(-(50 + bpad), 0); m_homePage = new BButton(btnRect, "homepagebtn", "BeTeX Homepage", new BMessage(AboutMessages::K_GOTO_BETEX_HOMEPAGE)); - m_gradient->AddChild(m_homePage); - btnRect.OffsetBy(-(80 + (2 * bpad)), 0); - btnRect.right = btnRect.left + 80; - m_beBits = new BButton( - btnRect, "fBeBitsbtn", "BeBits Page", new BMessage(AboutMessages::K_GOTO_BETEX_BEBITSPAGE)); - m_gradient->AddChild(m_beBits); - - btnRect.OffsetBy(-(60 + (2 * bpad)), 0); - btnRect.right = btnRect.left + 60; + btnRect.OffsetBy(-(120 + bpad), 0); + btnRect.left = btnRect.right - 60; m_donate = new BButton( btnRect, "fDonatebtn", "Donate", new BMessage(AboutMessages::K_GOTO_BETEX_DONATEPAGE)); + m_gradient->AddChild(m_donate); + m_gradient->AddChild(m_homePage); + m_gradient->AddChild(m_quit); BMessenger mymsnger(this); BMessage increment(UPDATE_COLORS); - + m_run = new BMessageRunner(mymsnger, &increment, UPDATE_TIME, -1); m_msgr = messenger; } AboutWindow::~AboutWindow() { delete m_msgr; + delete m_run; } void @@ -195,19 +193,13 @@ AboutWindow::MessageReceived(BMessage* msg) } break; case AboutMessages::K_GOTO_BETEX_HOMEPAGE: { - const char* url = "http://misza.beosjournal.org"; - be_roster->Launch("text/html", 1, (char**)&url); - Quit(); - } break; - case AboutMessages::K_GOTO_BETEX_BEBITSPAGE: - { - const char* url = "http://www.bebits.com/app/3919"; + const char* url = "https://github.com/HaikuArchives/BeTeX"; be_roster->Launch("text/html", 1, (char**)&url); Quit(); } break; case AboutMessages::K_GOTO_BETEX_DONATEPAGE: { - const char* url = "http://misza.beosjournal.org/donate.html"; + const char* url = "https://www.haiku-inc.org/donate"; be_roster->Launch("text/html", 1, (char**)&url); Quit(); } break; diff --git a/Src/Source/DimensionWindow.cpp b/Src/Source/DimensionWindow.cpp index 2f7d3d4..be572e7 100644 --- a/Src/Source/DimensionWindow.cpp +++ b/Src/Source/DimensionWindow.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include "Constants.h" #include "MessageFields.h" diff --git a/Src/Source/MainWindow.cpp b/Src/Source/MainWindow.cpp index 5ef17f7..2df6e6b 100644 --- a/Src/Source/MainWindow.cpp +++ b/Src/Source/MainWindow.cpp @@ -25,11 +25,6 @@ using std::cout; using std::endl; #include "Constants.h" -#include "ConverterIcons.h" -#include "DocView.h" -#include "MainTBar.h" -#include "MessageFields.h" -#include "Preferences.h" #include "TexFileFilter.h" #include "Toolbar.h" #include "ToolbarButton.h" diff --git a/Src/Source/PrefsListView.cpp b/Src/Source/PrefsListView.cpp index 8ab5b9b..f4f2dca 100644 --- a/Src/Source/PrefsListView.cpp +++ b/Src/Source/PrefsListView.cpp @@ -21,6 +21,7 @@ PrefsListView::PrefsListView(BRect frame, BView* parent, BMessenger* messenger) } PrefsListView::~PrefsListView() {} + void PrefsListView::SelectionChanged() {