aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntony Kellermann2018-09-26 18:18:00 -0400
committerAntony Kellermann2018-09-26 18:18:00 -0400
commit5a94f8cbdd261a776d4364a50fab06e0b010b706 (patch)
tree91a41681c579c07754cad0520e327d45194188f2
parent7daac0f22c987363c5f3c314b16ada8b6a42ae02 (diff)
downloadaur-5a94f8cbdd261a776d4364a50fab06e0b010b706.tar.gz
Implemented basic graph for GTK+
-rw-r--r--gtk_win.c94
-rw-r--r--gtk_win.h7
-rw-r--r--window_main.glade926
3 files changed, 567 insertions, 460 deletions
diff --git a/gtk_win.c b/gtk_win.c
index 821f114520ce..208ebfb4a772 100644
--- a/gtk_win.c
+++ b/gtk_win.c
@@ -373,8 +373,6 @@ void on_search_entry_focus_in_event(GtkWidget* search_entry, GdkEvent* event) {
for (size_t i = 0; i < app.iex_ref_data->length; i++) {
gtk_list_store_append(list_store, &iter);
gtk_list_store_set(list_store, &iter, 0, app.iex_ref_data->symbols[i], -1);
- //gtk_list_store_append(list_store, &iter);
- //gtk_list_store_set(list_store, &iter, 0, app.iex_ref_data->names[i], -1);
}
}
@@ -388,6 +386,97 @@ void on_search_entry_activate(GtkEntry* entry) {
symbol_show_info(modstr);
}
+gboolean on_info_graph_drawing_area_draw(GtkWidget* widget, cairo_t* cr) {
+ GdkRectangle da;
+ gdouble dx = 2.0, dy = 2.0;
+ gdouble graph_origin_x = 0.0, graph_origin_y = 0.0, graph_max_x = 0.0, graph_max_y = 0.0;
+ gdk_window_get_geometry(gtk_widget_get_window(widget), &da.x, &da.y, &da.width, &da.height);
+
+ cairo_translate(cr, da.width / 10, 9 * da.height / 10);
+ cairo_scale(cr, 1, -1); // Flip to be more intuitive
+
+ cairo_device_to_user_distance(cr, &dx, &dy);
+ cairo_clip_extents(cr, &graph_origin_x, &graph_origin_y, &graph_max_x, &graph_max_y);
+ cairo_set_line_width(cr, 2.0);
+
+ cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+ cairo_move_to(cr, 0.0, 0.0);
+ cairo_line_to(cr, graph_max_x, 0.0);
+ cairo_move_to(cr, 0.0, 0.0);
+ cairo_line_to(cr, 0.0, graph_max_y);
+ cairo_stroke(cr);
+
+ time_t now = time(NULL);
+ struct tm today_date = *localtime(&now), start_date = today_date;
+ start_date.tm_year -= 5;
+ double seconds = difftime(mktime(&today_date), mktime(&start_date));
+ int trading_days = (int) ((1.0 / DAYS_TO_BUSINESS_DAYS_RATIO) * seconds / 86400.0);
+ if (trading_days - app.focused->num_points > 0)
+ info_chart_fill_empty(app.focused, trading_days);
+
+ double max = app.focused->points[0], min = app.focused->points[0];
+ for (int i = 1; i < app.focused->num_points; i++) {
+ if (app.focused->points[i] > max)
+ max = app.focused->points[i];
+ if (app.focused->points[i] < min)
+ min = app.focused->points[i];
+ }
+
+ cairo_set_line_width(cr, 1.0);
+ cairo_move_to(cr, 0.0, 0.0);
+
+ double line_diff = (max - min) / graph_max_y, day_close;
+ for (gdouble i = 0, y; i < graph_max_x; i++) {
+ day_close = app.focused->points[(int) ((double) i * app.focused->num_points / graph_max_x)];
+ y = (day_close - min) / line_diff;
+ cairo_line_to(cr, i, y);
+ }
+
+ cairo_stroke(cr);
+
+ cairo_set_line_width(cr, 0.3);
+ int square_side_length = 20;
+ for (gdouble x = 0; x < graph_max_x; x += square_side_length) {
+ cairo_move_to(cr, x, 0.0);
+ cairo_line_to(cr, x, graph_max_y);
+ }
+
+ for (gdouble y = 0; y < graph_max_y; y += square_side_length) {
+ cairo_move_to(cr, 0.0, y);
+ cairo_line_to(cr, graph_max_x, y);
+ }
+
+ cairo_stroke(cr);
+
+ cairo_translate(cr, -da.width / 10, 0);
+ gchar text[16];
+ for (int y = 0; y < graph_max_y; y += square_side_length) {
+ cairo_move_to(cr, 0, y);
+ sprintf(text, "%.2lf", min + line_diff * y);
+ cairo_scale(cr, 1, -1); // Text will print upside down if not scaled back
+ cairo_show_text(cr, text);
+ cairo_scale(cr, 1, -1);
+ }
+
+ cairo_translate(cr, da.width / 10, 0);
+
+ double days_per_col_spacing = (DAYS_TO_BUSINESS_DAYS_RATIO * trading_days) /
+ (graph_max_x / square_side_length);
+ struct tm x_label_time = start_date;
+ for (int i = 0; i < graph_max_x; i += 4 * square_side_length) {
+ if (i != 0)
+ x_label_time.tm_sec += days_per_col_spacing * 4 * 86400.0;
+ mktime(&x_label_time);
+ strftime(text, 16, "%D", &x_label_time);
+ cairo_move_to(cr, i, -10);
+ cairo_scale(cr, 1, -1); // Text will print upside down if not scaled back
+ cairo_show_text(cr, text);
+ cairo_scale(cr, 1, -1);
+ }
+
+ return FALSE;
+}
+
void symbol_show_info(const char* symbol) {
Info* pInfo = info_array_find_symbol_recursive(app.portfolio_data, symbol);
if (pInfo == NULL)
@@ -411,6 +500,7 @@ void symbol_show_info(const char* symbol) {
if (pInfo->peers != NULL)
format_cells(pInfo->peers);
+ app.focused = pInfo;
info_pane_populate_all(pInfo);
GtkContainer* window = GTK_CONTAINER(GET_OBJECT("check_window"));
gtk_container_remove(window, GTK_WIDGET(GET_OBJECT("check_pane")));
diff --git a/gtk_win.h b/gtk_win.h
index 8d3722769803..e274ffe6ad40 100644
--- a/gtk_win.h
+++ b/gtk_win.h
@@ -17,6 +17,10 @@ typedef enum column_index {
PROFIT_7D_PERCENT, PROFIT_30D, PROFIT_30D_PERCENT, NUM_COLS
} Col_Index;
+typedef enum zoom_level_total_months {
+ FIVE_Y, FOUR_Y, THREE_Y, TWO_Y, ONE_Y, SIX_M, THREE_M, ONE_M, FOURTEEN_D, SEVEN_D
+} Zoom_Months;
+
typedef struct app_data {
Info_Array* portfolio_data;
String* portfolio_string;
@@ -25,6 +29,7 @@ typedef struct app_data {
Info_Array* info_cache;
char password[PASS_MAX];
time_t last_reload;
+ Info* focused;
} App_Data;
/**
@@ -212,6 +217,8 @@ void info_pane_populate_peers(const Info* pInfo);
void info_pane_populate_news(const Info* pInfo);
+gboolean on_info_graph_drawing_area_draw(GtkWidget* widget, cairo_t* cr);
+
/**
* Shows a generic message dialog.
* @param message the message to show
diff --git a/window_main.glade b/window_main.glade
index 39b1a22a3048..9f1e17d1d57a 100644
--- a/window_main.glade
+++ b/window_main.glade
@@ -62,18 +62,6 @@ https://github.com/aokellermann/
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkListStore" id="peers_list">
- <columns>
- <!-- column-name Symbol -->
- <column type="gchararray"/>
- <!-- column-name 24H% -->
- <column type="gchararray"/>
- <!-- column-name 7D% -->
- <column type="gchararray"/>
- <!-- column-name 30D% -->
- <column type="gchararray"/>
- </columns>
- </object>
<object class="GtkPaned" id="info_pane">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -255,450 +243,245 @@ https://github.com/aokellermann/
</packing>
</child>
<child>
- <object class="GtkBox" id="info_main_box">
+ <object class="GtkGrid" id="info_main_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="homogeneous">True</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
<child>
- <object class="GtkBox" id="info_left_box">
+ <object class="GtkScrolledWindow" id="info_company_scroll_window">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="homogeneous">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkScrolledWindow" id="info_company_scroll_window">
+ <object class="GtkViewport" id="info_company_viewport">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
+ <property name="can_focus">False</property>
<child>
- <object class="GtkViewport" id="info_company_viewport">
+ <object class="GtkBox" id="info_company_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">8</property>
<child>
- <object class="GtkBox" id="info_company_box">
+ <object class="GtkLabel" id="info_description_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <object class="GtkLabel" id="info_description_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="info_company_middle_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
+ <property name="homogeneous">True</property>
<child>
- <object class="GtkBox" id="info_company_middle_box">
+ <object class="GtkGrid" id="info_company_left_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">5</property>
- <property name="homogeneous">True</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
<child>
- <object class="GtkGrid" id="info_company_left_grid">
+ <object class="GtkLabel" id="info_ceo">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="row_homogeneous">True</property>
- <property name="column_homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="info_ceo">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">CEO:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_ceo_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_sector">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Sector:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_sector_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_revenue_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_revenue">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Revenue:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_cash">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Cash:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_cash_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_market_cap">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Market Cap:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_market_cap_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_pe_ratio_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_pe_ratio">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">P/E Ratio:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
+ <property name="label" translatable="yes">CEO:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="info_company_right_grid">
+ <object class="GtkLabel" id="info_ceo_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="row_homogeneous">True</property>
- <property name="column_homogeneous">True</property>
- <child>
- <object class="GtkLabel" id="info_website">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Website:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_website_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_industry">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Industry:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_industry_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_gross_profit">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Gross Profit:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_gross_profit_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_debt">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Debt:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_debt_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_volume">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Volume:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_div_yield_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_div_yield">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Dividend Yield:</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="info_volume_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_sector">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Sector:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="info_earnings_grid">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_homogeneous">True</property>
- <property name="column_homogeneous">True</property>
<child>
- <object class="GtkLabel" id="info_fiscal_period_label1">
+ <object class="GtkLabel" id="info_sector_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_fiscal_period_label2">
+ <object class="GtkLabel" id="info_revenue_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_fiscal_period_label3">
+ <object class="GtkLabel" id="info_revenue">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="label" translatable="yes">Revenue:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">3</property>
- <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_fiscal_period_label4">
+ <object class="GtkLabel" id="info_cash">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="label" translatable="yes">Cash:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">4</property>
- <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_cash_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps">
+ <object class="GtkLabel" id="info_market_cap">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">EPS</property>
+ <property name="label" translatable="yes">Market Cap:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_label1">
+ <object class="GtkLabel" id="info_market_cap_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_label2">
+ <object class="GtkLabel" id="info_pe_ratio_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_pe_ratio">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">P/E Ratio:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="info_company_right_grid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="info_website">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Website:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_website_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_label3">
+ <object class="GtkLabel" id="info_industry">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="label" translatable="yes">Industry:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">3</property>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_label4">
+ <object class="GtkLabel" id="info_industry_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
- <property name="left_attach">4</property>
+ <property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_previous">
+ <object class="GtkLabel" id="info_gross_profit">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Previous Year</property>
+ <property name="label" translatable="yes">Gross Profit:</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -707,7 +490,7 @@ https://github.com/aokellermann/
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_previous_label1">
+ <object class="GtkLabel" id="info_gross_profit_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -717,178 +500,383 @@ https://github.com/aokellermann/
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_previous_label2">
+ <object class="GtkLabel" id="info_debt">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="label" translatable="yes">Debt:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_previous_label3">
+ <object class="GtkLabel" id="info_debt_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
- <property name="left_attach">3</property>
- <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_eps_previous_label4">
+ <object class="GtkLabel" id="info_volume">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="label" translatable="yes">Volume:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">4</property>
- <property name="top_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_div_yield_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="info_fiscal_period">
+ <object class="GtkLabel" id="info_div_yield">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Fiscal Period</property>
+ <property name="label" translatable="yes">Dividend Yield:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_volume_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="info_earnings_grid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="info_fiscal_period_label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_fiscal_period_label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_fiscal_period_label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_fiscal_period_label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">EPS</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_previous">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Previous Year</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_previous_label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_previous_label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_previous_label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_eps_previous_label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_fiscal_period">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Fiscal Period</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="info_related_scroll_window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkBox" id="info_peers_box">
+ <object class="GtkViewport" id="info_related_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="info_peers_label">
+ <object class="GtkBox" id="info_peers_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Related stocks:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="info_peers_scroll_window">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="info_peers_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Related stocks:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
- <object class="GtkTreeView" id="info_peers_tree_view">
+ <object class="GtkScrolledWindow" id="info_peers_scroll_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="model">peers_list</property>
- <property name="enable_search">False</property>
- <property name="show_expanders">False</property>
- <property name="enable_grid_lines">both</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="info_peers_tree_selection"/>
- </child>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkTreeViewColumn" id="peers_symbol_column">
- <property name="title" translatable="yes">Symbol</property>
- <property name="expand">True</property>
+ <object class="GtkTreeView" id="info_peers_tree_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">peers_list</property>
+ <property name="enable_search">False</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <property name="enable_grid_lines">both</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
<child>
- <object class="GtkCellRendererText" id="peers_symbol_column_renderer">
- <property name="xalign">1</property>
+ <object class="GtkTreeViewColumn" id="peers_symbol_column">
+ <property name="title" translatable="yes">Symbol</property>
+ <property name="expand">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="peers_symbol_column_renderer">
+ <property name="xalign">1</property>
+ </object>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
</object>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
</child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="peers_24H%_column">
- <property name="title" translatable="yes">24H%</property>
- <property name="expand">True</property>
<child>
- <object class="GtkCellRendererText" id="peers_24H%_column_renderer">
- <property name="xalign">1</property>
- <property name="alignment">right</property>
+ <object class="GtkTreeViewColumn" id="peers_24H%_column">
+ <property name="title" translatable="yes">24H%</property>
+ <property name="expand">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="peers_24H%_column_renderer">
+ <property name="xalign">1</property>
+ <property name="alignment">right</property>
+ </object>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
</object>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
</child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="peers_7D%_column">
- <property name="title" translatable="yes">7D%</property>
- <property name="expand">True</property>
<child>
- <object class="GtkCellRendererText" id="peers_7D%_column_renderer">
- <property name="xalign">1</property>
- <property name="alignment">right</property>
+ <object class="GtkTreeViewColumn" id="peers_7D%_column">
+ <property name="title" translatable="yes">7D%</property>
+ <property name="expand">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="peers_7D%_column_renderer">
+ <property name="xalign">1</property>
+ <property name="alignment">right</property>
+ </object>
+ <attributes>
+ <attribute name="text">2</attribute>
+ </attributes>
+ </child>
</object>
- <attributes>
- <attribute name="text">2</attribute>
- </attributes>
</child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="peers_30D%_column">
- <property name="title" translatable="yes">30D%</property>
- <property name="expand">True</property>
<child>
- <object class="GtkCellRendererText" id="peers_30D%_column_renderer">
- <property name="xalign">1</property>
- <property name="alignment">right</property>
+ <object class="GtkTreeViewColumn" id="peers_30D%_column">
+ <property name="title" translatable="yes">30D%</property>
+ <property name="expand">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="peers_30D%_column_renderer">
+ <property name="xalign">1</property>
+ <property name="alignment">right</property>
+ </object>
+ <attributes>
+ <attribute name="text">3</attribute>
+ </attributes>
+ </child>
</object>
- <attributes>
- <attribute name="text">3</attribute>
- </attributes>
</child>
</object>
</child>
</object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
@@ -938,9 +926,19 @@ https://github.com/aokellermann/
</child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="info_graph_drawing_area">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <signal name="draw" handler="on_info_graph_drawing_area_draw" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
</object>
@@ -950,6 +948,18 @@ https://github.com/aokellermann/
</packing>
</child>
</object>
+ <object class="GtkListStore" id="peers_list">
+ <columns>
+ <!-- column-name Symbol -->
+ <column type="gchararray"/>
+ <!-- column-name 24H% -->
+ <column type="gchararray"/>
+ <!-- column-name 7D% -->
+ <column type="gchararray"/>
+ <!-- column-name 30D% -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkListStore" id="search_entry_completion_store">
<columns>
<!-- column-name Symbol -->